bgrins / TinyColor

Fast, small color manipulation and conversion for JavaScript

Home Page:https://bgrins.github.io/TinyColor/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HSL: Saturation = 1 returns fully saturated color

getflourish opened this issue · 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.