Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Dhax Dalumpines
  Where is Dhax Dalumpines?
 
 Philippines
 Dhax Dalumpines
 Tags
Subject: RE: GetColor Function
Thread ID: 79816 Message ID: 79893 # Views: 19 # Ratings: 1
Version: Visual FoxPro 8 Category: General VFP Topics
Date: Sunday, October 23, 2005 7:15:20 AM         
   


> > 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


COMPLETE THREAD

GetColor Function Posted by Dhax Dalumpines @ 10/22/2005 4:45:03 AM
RE: GetColor Function Posted by dan delpuerto @ 10/22/2005 5:05:47 AM
RE: GetColor Function Posted by Dhax Dalumpines @ 10/22/2005 6:47:16 AM
RE: GetColor Function Posted by Eric den Doop @ 10/22/2005 9:16:30 AM
RE: GetColor Function Posted by Dhax Dalumpines @ 10/22/2005 10:32:13 AM
RE: GetColor Function Posted by dan delpuerto @ 10/22/2005 3:34:25 PM
RE: GetColor Function Posted by Boudewijn Lutgerink @ 10/23/2005 7:15:20 AM
RE: GetColor Function Posted by Marcia Akins @ 10/22/2005 3:35:31 PM