Jump to content

How to set RGB color code


gear
 Share

Recommended Posts

'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)
EndFunc

;// 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
EndFunc
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...