Jump to content
Sign in to follow this  

How to set RGB color code

Recommended Posts

The setting for RGB color is strange, like 0x8080ff , how can I know what is the code for white color?


Share this post

Link to post
Share on other sites

'Googling' you can found many tools for get color's code, like this online tool and this chart.

You can view that white color in HEX Format is: 0xFFFFFF, in RGB is 255,255,255.

Additionally, some from my old library of functions, modify it as you need it:

;// Converter: RGB To Hexadecimal format (parameters "Red, Green, Blue" (0-255)
Func _RGB2HEX($_rgb)
    $rgbComp = StringSplit( StringStripWS($_rgb, 8), ',')
    Return Hex( BitAND($rgbComp[1], 255), 2) & Hex( BitAND($rgbComp[2], 255), 2) & Hex( BitAND($rgbComp[3], 255), 2)

;// Converter: Hexadecimal To RGB format
Func _HEX2RGB($_hex)
    Local $R = Dec(StringMid($_hex, 1, 2))
    Local $G = Dec(StringMid($_hex, 3, 2))
    Local $B = Dec(StringMid($_hex, 5, 2))
    Return $R & ',' & $G & ',' & $B

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...