Join
Sign in
Search Options
Search Everything
Search Formats
Home
Blog
Resources
Forums
About Open XML
More ...
Home
»
Forums
»
Formats
»
Open Packaging Convention
»
RGB to HSL conversion
Re: RGB to HSL conversion
Formats
Discussions about working with different Open XML Formats
Get this RSS feed
Details
2
Replies
0
Subscribers
Posted
over 1 year ago
Options
Subscribe via RSS
Share this
Open Packaging Convention
RGB to HSL conversion
rated by 0 users
This post has
2 Replies |
0
Followers
IamSathish
25
Posted by
IamSathish
on
Mon, Apr 25 2011 7:11 AM
rated by 0 users
Post Points: 20
RGB to HSL conversion
Hi,
I am working on the RGB to HSL conversion to apply the tint. Could any one provide me the RGB to HSL ECMA conversion algorithm download link.
Thanks,
Sathish
tarun thakur
315
Posted by
tarun thakur
on
Mon, Apr 25 2011 9:02 AM
rated by 0 users
Post Points: 20
Re: RGB to HSL conversion
Convert rgb into hsl and then apply the following transformation on luminosity.
l = (l * tint / 100.0f) + (1.0f - tint / 100.0f)
1) where l is luminosity.
2) tint=tint/1000.0;
Convert back to rgb.
IamSathish
25
Posted by
IamSathish
on
Mon, Apr 25 2011 11:06 AM
rated by 0 users
Post Points: 5
Re: RGB to HSL conversion
Hi,
Thank you for the information. I referred Wiki pedia (http://en.wikipedia.org/wiki/HSL_and_HSV) and created the conversion algorithm. This algorithm works fine, I converted the RGB 31, 73, 125 value to HSL and again converted back to RGB returns the same. However I referred the ECMA and applied the below tint algorithm to HSL value and converted back returns the RBG value 142,180,227 instead of 141,180,226. Excel shows 141,180,226.
Tint Value:0.6
l*-=255;
l = l * (1.0 - dTint) + (255- 255* (1.0 - dTint)); where l is Luminance
l/=255
I referred both the algorithm in different location and I did some modification both in conversion and tint algorithm. Finally the resultant value is not correct so i need both the algorithm from ECMA itself. Could you please help on this?
Thanks,
Sathish
Page 1 of 1 (3 items)