What formula is used for the conversion of color in Hex form to color in Decimal form and how would you include the conversion in a script?
I use the MsgBox script shown below to obtain current mouse coords (1st line) and the color of the pixel at that location (2nd line). The color returned by AHK is a Hex code in BGR. However, I would like to also include a 3rd line which displays the color in RGB Decimal so that it's ready to insert into MS Office apps if needed.
Code: Select all
^F6:: ; GetMousePosition and pixel color_Screen CoordMode, Mouse, Screen MouseGetPos, xpos, ypos CoordMode, Pixel, Screen PixelGetColor, color, %xpos%, %ypos% Msgbox, The cursor is located at x = %xpos% & y = %ypos%. (Join, `nThe color of that pixel is (BGR) %color% `nor (RGB) ### ### ### ) Return