Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RGB() opposite function needed !!
Message
From
16/12/2002 11:58:02
 
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00733312
Message ID:
00733314
Views:
17
Here is some old code that I had:

Function RGB_Split
Lparameters lnColor

#DEFINE RGB_RED 256^0
#DEFINE RGB_GREEN 256^1
#DEFINE RGB_BLUE 256^2

Local lnRed, lnGreen, lnBlue
Store 0 To lnRed, lnGreen, lnBlue

lnBlue = Int(lnColor / RGB_BLUE)
lnColor = lnColor - (lnBlue * RGB_BLUE)

lnGreen = Int(lnColor / RGB_GREEN)
lnColor = lnColor - (lnGreen * RGB_GREEN)

lnRed = lnColor

? " R=" + Alltrim(Str(lnRed,3,0)) + " G=" + Alltrim(Str(lnGreen,3,0)) + " B=" + Alltrim(Str(lnBlue,3,0))
Return ("")

*-EOC-*



>Hi Guys!
>
>Id like to know if thier is a way to obtain the three values of Red, Green and Blue for any given color.
>
>For example:
>
>lnColorNumber = rgb(25,110,205)
>
>loColors = MagicFunction(lnColorNumber)
>
>?loColors.Red
>?loColors.Blue
>?loColors.Green
>
>
>Thanks in advance guys !!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform