bgrins/TinyColor

HSL: Saturation = 1 returns fully saturated color

getflourish opened this issue · 1 comments

When getting the hex string of a non saturated color, a fully saturated color is returned.

The example compares a color with saturation = 1 and saturation = 0, whereas 1 returns full saturation. While 2 returns low saturation.

image

https://codepen.io/getflourish/pen/WYVNoV


let a = tinycolor({
      h: 0,
      s: 0,
      l: 52
    }).toHexString()

let b = tinycolor({
      h: 0,
      s: 1,
      l: 52
    }).toHexString()


let c = tinycolor({
      h: 0,
      s: 2,
      l: 52
    }).toHexString()

Oh, I figure, I should explicitly add "%" to the values.