Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert results of GETCOLOR() to RGB values
Message
From
17/03/1998 06:27:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
16/03/1998 15:11:45
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00084415
Message ID:
00084974
Views:
44
>>>I am using the GETCOLOR() function to allow users to specify the color of bar chart columns. The return value is a number from 0 to 16777215 (black to white). Is there a function that can take this value and return the RGB combination for the color? An example is dark blue returns 16711680, but what I really want to know is the RGB combination of 0,0,255.
>>Mark,
>>
>>Ed and George have told you how to do this, but I would ask why bother? You can;
>>
>> THISFORM.Text1.ForeColor = 16711680
>>
>>So why bother to convert the color return value from getcolor(), just use it.
>
>The main reason is to display the values to the user in spinners. They can use the spinners to increase or decrease the values, thus changing the color without having to go back to GETCOLOR().
Hi,
I guess you already have this code. If so pls ignore.
This is the code I use in my builder for similar purpose :
function cn2rgb
lparameters nColor
return "RGB("+ ;
	str(nColor%256,3)+","+;
	str(floor(nColor%256^2 / 256),3)+","+;
	str(floor(nColor / 256^2),3)+")"
Pls notice that a string value is returned.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform