General information
Category:
Coding, syntax & commands
Title:
Bug in RGB() function
Environment versions
Network:
Windows 2008 Server
Either I am missing something or there is a significant bug in the RGB function.
The value of RGB((204,198,149) is returned as 9815756. In hex this is #95C6CC.
That is completely wrong. The value of RGB(204,198,149) is 13420181. In hex that is #CCC695.
I finally figured out the problem: any time the first number was > 99, the RGB() function is returning the number of the RGB in _opposite_ order! IOW the value of RGB(204,198,149) should be 13420181, yet VFP returns 9815756. However doing the RGB backwards, as in RGB(149,198,204) results in the correct decimal for the original order: 13420181.
VFP is reversing the parameters, seemingly randomly, but I ran that RGB on 3 different PC's and it always came up the same wrong answer.
Anybody know anything about this?
TIA
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only