Converting RGB to Hex colours

Hello, does anyone know a way to convert from rgb to hex. I want to pass hex colours to an arduino via bluetooth / serial port and to reduce the size of the output string I want to use hex numbers it will also save me from converting it from my css. From what I have searched every one wants to convert from hex to rgb. Also what is the colour scale used by ai2 for example Red is "4294901760" I got this number with the block below.


how does this relate to rgb or hex (HSV for that matter) I also found the colour list in th ai2 help

Oops I think I've sorted it myself there is a base to hex block in maths. I didn't notice. So easy ai2 is ace

Such a procedure will do it.

3 Likes

oh thank you I was just working on it :smiley:

You can also use extension:

2 Likes

thanks Patryk the blocks work great, I will take a look at your extension cheers

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.