GetColor()
This function brings up the Windows Color Picker dialog and returns the color chosen.
Usage |
nColor = GETCOLOR ( [ nDefaultColor ] ) |
Parameter |
Value |
Meaning |
nDefaultColor |
Numeric |
A number from 0 to 16,777,215 representing the default color to be highlighted in the Color Picker. |
nColor |
-1 |
The user pressed Esc or clicked Cancel. |
0 - 16,777,215 |
The number of the color chosen by the user. |
Example |
* ParsColr.PRG * Get a color and Parse it into its RGB components. * Set all three to -1 if the user cancels. * This is a native code alternative to the FoxTools * RGBComp() function. * Sample call: * STORE -1 TO nRed, nGreen, nBlue * DO ParsColr WITH nRed,nGreen,nBlue LPARAMETERS nRed, nGreen, nBlue LOCAL nColor nColor = GETCOLOR() IF nColor<>-1 && user didn't cancel nBlue = INT(nColor/(256^2)) nColor = MOD(nColor,(256^2)) nGreen = INT(nColor/256) nRed = MOD(nColor,256) ELSE STORE -1 to nBlue, nGreen, nRed ENDIF RETURN |
See Also |