Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reverse the RGB() function.
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00208339
Message ID:
00208481
Views:
30
>Okay doesn't ask why, we just need to do it. We want to take a color value and return the 3 color numbers that the RGB()function uses.
>
> rgb(255,200,100) returns 6605055
> We want to pass 6605055 to a function and get 255,200,100 returned.
>
>Thanx.

Fred,

As an alternative, there's a funtion in FoxTools that does just that:
RGBComp( nRGBColor, @nRedVal, @nGreenVal, @nBlueVal )
nRGBColor

Specifies a composite RGB color value ranging from 0 to 16777215.

@nRedVal

Specifies a reference to a variable in which the function returns the intensity of the red color component of nRGBColor.

@nGreenVal

Specifies a reference to a variable in which the function returns the intensity of the green color component of nRGBColor.

@nBlueVal

Specifies a reference to a variable in which the function returns the intensity of the blue color component of nRGBColor.

José
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform