GetColor (Documentation Bugs and Problems)

by Samuel Krepelka @, Saturday, November 24, 2012, 16:32 (1794 days ago)

Definition:
Returns the RGB value of the current drawing color (last set by color statement). RGB is calculated by taking ((red * 256) + green * 256) + blue where red, green, and blue are between 0 and 255. If the drawing color has been set to CLEAR a -1 will be returned.


There is something missing in the formula.

GetColor

by lrcvs, Saturday, November 24, 2012, 18:36 (1794 days ago) @ Samuel Krepelka

RGB = ((RED*256)^2) + (GREEN*256) + BLUE

Regards

GetColor

by Jim ⌂ @, Russell, KY, Sunday, November 25, 2012, 01:52 (1794 days ago) @ lrcvs

Actually your parenthesis is in the wrong place. The formula is:

RGB = RED*(256^2) + GREEN*256 + BLUE

OR

RGB = (red * 256 + green) * 256 + blue

GetColor

by lrcvs, Sunday, November 25, 2012, 06:43 (1793 days ago) @ Jim

Ok!

RSS Feed of thread
powered by my little forum