Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP & RGB Color Codes
Message
De
14/01/2000 05:22:06
 
 
À
14/01/2000 04:52:26
Upendra Nayak
Cadsys Technologies
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00318079
Message ID:
00318084
Vues:
20
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform