Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting Color Property Values to Text
Message
From
14/08/2002 08:43:34
 
 
To
14/08/2002 07:26:55
Herb Ellerbock
Customized Computer Systems
Australia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00689475
Message ID:
00689497
Views:
32
The following works for me:
*FUNCTION GC2RGB
PARAMETERS p_nColor
PRIVATE l_nRed, l_nGreen, l_nBlue

IF PCOUNT() < 1 OR TYPE("p_nColor") <> "N"
    RETURN ""
ENDIF
IF !BETWEEN(p_nColor, 0, 256^3-1)
    RETURN ""
ENDIF

l_nRed = MOD(p_nColor, 256)
l_nGreen = MOD(INT(p_nColor/256), 256)
l_nBlue =  MOD(INT(p_nColor/(256*256)), 256)

RETURN "RGB("+ALLTRIM(STR(l_nRed));
 +","+ALLTRIM(STR(l_nGreen));
 +","+ALLTRIM(STR(l_nBlue))+")"
Rick

>Hello Everybody,
>
>I want to set the DynamicForeColor and DynamicBackColor Properties in a grid to the ForeColor and BackColor Properties of another object. This requires me to convert the ForeColor and BackColor Properties to text, e.g. RGB(0,0,128) to 'RGB(0,0,128)'.
>
>I would appreciate any help with how this can be done?
>
>Thanks,
>Herb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform