RGB color to HSL

Problems building or running the engine, queries about how to use features etc.
Post Reply
xelon
Halfling
Posts: 91
Joined: Mon Jan 07, 2013 4:24 am
x 13

RGB color to HSL

Post by xelon »

Hi,
Is there a built in function that converts an RGB color to HSL(Hue,Saturation,Light) and vice-versa?
I need to brighten a given RGB color without loosing the color information. Simply multiplying the color by 1.5 or 2.0 wont work for me because if one of the RGB channels is over 255, the color value will become unbalanced.
Ludoria now on Kickstarter! Ludoria is now on KickStarter! https://www.kickstarter.com/projects/17 ... g-rpg-game
Ludoria's official website http://www.Ludoria.com
On Facebook https://www.facebook.com/pages/Ludoria/644733108967479
On Twitter https://twitter.com/LudoriaGame
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: RGB color to HSL

Post by c6burns »

Just looking at the API quickly there is a set/getHSB:
http://www.ogre3d.org/docs/api/1.9/clas ... 403482eaae
xelon
Halfling
Posts: 91
Joined: Mon Jan 07, 2013 4:24 am
x 13

Re: RGB color to HSL

Post by xelon »

c6burns wrote:Just looking at the API quickly there is a set/getHSB:
http://www.ogre3d.org/docs/api/1.9/clas ... 403482eaae
Omg thanks lol. I don't know how I missed that. Google failed me this time.
Ludoria now on Kickstarter! Ludoria is now on KickStarter! https://www.kickstarter.com/projects/17 ... g-rpg-game
Ludoria's official website http://www.Ludoria.com
On Facebook https://www.facebook.com/pages/Ludoria/644733108967479
On Twitter https://twitter.com/LudoriaGame
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: RGB color to HSL

Post by c6burns »

It happens! Your last question about colour had a simple answer I overlooked by not going straight to the API, so I went there first this time :lol:
Post Reply