Hello,
I need to calculate the lighter/darker shade of a given color .
Example, The form is set to clBtnFace, I want to set some controls on the form to a color just a bit lighter than clBtnFace and some other controls to a color just a bit darker than clBtnFace. Without changing the color itself, just changing the shade of it.
I think I need to convert the D6 RGB color clBtnFace to HSL representation, then I could add/subtract from L (Luminosity), then convert back to RGB and assign to the color property of my control.
I have tried to use some RGBtoHSL converter procedures and they have not seemed to work as I expected. I would have thought that if I do RGBtoHSL, then without changing the numbers just do HSLtoRGB, then I would have ended up with the same color I started with. Nope, I get black??
[flush]
Has anyone ever tried anything like this?
Have you got any ideas which may help me?
Thanks.
Tim Dover
SNL Computing
I need to calculate the lighter/darker shade of a given color .
Example, The form is set to clBtnFace, I want to set some controls on the form to a color just a bit lighter than clBtnFace and some other controls to a color just a bit darker than clBtnFace. Without changing the color itself, just changing the shade of it.
I think I need to convert the D6 RGB color clBtnFace to HSL representation, then I could add/subtract from L (Luminosity), then convert back to RGB and assign to the color property of my control.
I have tried to use some RGBtoHSL converter procedures and they have not seemed to work as I expected. I would have thought that if I do RGBtoHSL, then without changing the numbers just do HSLtoRGB, then I would have ended up with the same color I started with. Nope, I get black??
[flush]
Has anyone ever tried anything like this?
Have you got any ideas which may help me?
Thanks.
Tim Dover
SNL Computing