Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
20 most used distinct visible colors
Message
From
07/12/2006 03:09:21
 
 
To
07/12/2006 02:54:29
Suhas Hegde
Dental Surgeon
Sirsi, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01175481
Message ID:
01175515
Views:
8
I don't know what you really mean. There are only 8 distinct colors if you don't want shades. With no shades, you mean each color can only be 0 or 255, so you have the following eight options:

1. RGB(0,0,0)
2. RGB(0,0,255)
3. RGB(0,255,0)
4. RGB(0,255,255)
5. RGB(255,0,0)
6. RGB(255,0,255)
7. RGB(255,255,0)
8. RGB(255,255,255)

If any color also can be 127, you have even more colors. You can easily create a small program to present all the different color combinations on the screen. Hey, wait, isn't that exactly what getcolor() does? :-)

Which are "most used" I really don't know, since I don't know of anyone ever have had any survey on this. Frankly, I think the solution I gave you is the best.


>Hi,
>
>I have the converts from nemeric to RGB courtesy UT posts
>
>I wanted to know 20 most used colors in RGB format distinct colors not shades
>
>thanx
>
>suhashegde
>
>
>
>>To find the rgb values for any color:
>>
?color2rgb(GetColor())
>>Here's my color2rgb function. It's a little "overkill" for your specific need, since it also can return only one color component, like ?color2rgb(16711808,'R') which will only give the red value. I need this functionality in some programs, so I created a generic function.
>>
>>Function color2rgb
>>  Lparameters lnColor,lcColor
>>  Local lnRed,lnGreen,lnBlue,lxReturn
>>  lnRed = Mod(lnColor, 256)
>>  lnGreen = Mod(Bitrshift(lnColor, 8), 256)
>>  lnBlue = Mod(Bitrshift(lnColor, 16), 256)
>>  Do Case
>>    Case Pcount()=1
>>      lxReturn=n2c(lnRed)+','+n2c(lnGreen)+','+n2c(lnBlue)
>>    Case Upper(lcColor)='R'
>>      lxReturn=lnRed
>>    Case Upper(lcColor)='G'
>>      lxReturn=lnGreen
>>    Case Upper(lcColor)='B'
>>      lxReturn=lnBlue
>>    Otherwise
>>      lxReturn=-1
>>  Endcase
>>Return lxReturn
>>NB! Note that you can use the (numeric) return value from getcolor() almost anywhere, so there's really no reason to convert to RGB.
>>
>>>hi,
>>>
>>>i need most commonly used 20 distint colors other than black and white
>>>
>>>CAn some1 list it please in RGB() format ?
>>>
>>>tia
>>>
>>>suhashegde
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform