Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP & RGB Color Codes
Message
From
14/01/2000 05:22:06
 
 
To
14/01/2000 04:52:26
Upendra Nayak
Cadsys Technologies
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00318079
Message ID:
00318084
Views:
21
Upendra,

You can use the GetColor() function to allow you to select the colour/shade you are specifically interested in. You can then use the RGBComp() function in FOXTOOLS.FLL to split the returned value into its component channels. The exact shade or colour available is also dependent on your PC's display adaptor and the colour depth its capable of displaying, for example:


LOCAL lnColour && This can be 0 to 16777215 or -1 for error/cancel.
LOCAL lnRed
LOCAL lnGreen
LOCAL lnBlue
LOCAL llReturnValue

set library to foxtools additive

lnColour = getcolor()

if lnColour = -1
? "Colour selection cancelled by user."
else
? "The getcolor() function returned: " + alltrim(str(lnColour))

llReturnValue = RGBComp(lnColour, @lnRed, @lnGreen, @lnBlue)

if llReturnValue = .T.
? "Red Component: " + alltrim(str(lnRed))
? "Green Component: " + alltrim(str(lnGreen))
? "Blue Component: " + alltrim(str(lnBlue))
else
? "RGBComp() function returned an error"
endif
endif


You can also use a package such as Adobe Photoshop/Corel Photopaint to look up RGB colours more accurately using Pantone swatches or RAL.
Previous
Reply
Map
View

Click here to load this message in the networking platform