Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Formulation to convert a color number to RGB breakdown
Message
From
20/11/2001 09:03:06
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00583871
Message ID:
00583873
Views:
23
This message has been marked as a message which has helped to the initial question of the thread.
>If you happen to know the formulation of converting a color # into RGB breakdown, could you please share it with me. For instance White color number is 16777215, I am looking formulation which gets RGB(255,255,255).
>
>Thank you,

16777215 = 255 * 256^2 + 255 * 256 + 255

To do the calculations the other way, use a combination of division, int(), and the % operator.

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform