> > This may do:
> >
> > n= nColor
> >
> > r = bitand(n, 255)
> > g = bitand(bitRshift(n, 8), 255)
> > b = bitand(bitRshift(n, 16), 255)
> >
> > *make a function out of this snippet
> > *convert r, g and b into string
> > *let me know if this worked for you
> >
> > > Dhax
> > >
> > > Hello!guys i have a problem about Getcolor() function.
> > >
> > > The return of this function is converted in RGB() value.
> > > What i am trying to achieve is to display the value of GetColor() into
> > > a string like '255,255,255' to a textbox.There is a way to convert the GetColor()
> > > value to a string?
> > >
> > > Pls..help me.
> > > Thank you...
> > >
> > > Best regards,
> > > dhax
>
>
>
> dhax
>
> Thanks Dan...
> But I am trying to say is just like in properties value of forecolor will display in the textbox.When i used GetColor function the return is, for example when i selected the color Blue in the GetColor dialog box the value displayed is 10485760. I want to display like this 0,0,160.It is possible?Here's a little function to do that:
*Function convertcolor()
LPARAMETERS lnColor
LOCAL r as Integer, g as Integer, b as Integer
r = bitand(lnColor, 255)
g = bitand(bitRshift(lnColor, 8), 255)
b = bitand(bitRshift(lnColor, 16), 255)
RETURN "RGB( "+TRANSFORM(r)+", "+TRANSFORM(g)+", "+TRANSFORM(b)+" )"
You can use this as in
?ConvertColor( getcolor())
Boudewijn Lutge®ink
My Blog is here