wordpress hit counter
Re: RGB to HSL conversion - Open Packaging Convention - Formats - OpenXML Developer

Re: RGB to HSL conversion

Formats

Discussions about working with different Open XML Formats

RGB to HSL conversion

  • rated by 0 users
  • This post has 2 Replies |
  • 0 Followers
  • 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
  • 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.
     


  • 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)