bebraw / colorjoe

Scaleable color picker with touch and AMD support (MIT)
http://bebraw.github.io/colorjoe/
MIT License
568 stars 68 forks source link

Issue with function RGB_BG for HSL #55

Closed rdabbir-crestron closed 1 year ago

rdabbir-crestron commented 1 year ago

I found an issue with the RGB_BG function used for HSL. The color should change when the bottom most value is picked in the color picker. The same can be viewed in MS Paint Color grid. The fix for this is as below:

function RGB_BG_HSL(e, h) {
    utils.BG(e, h);
}

colorjoe.hsl = colorjoe({ xy: function (col, p, xy, z) { ....... RGB_BG_HSL(z.background, col.css());

        return col.hue(p.x).saturation(1 - p.y);
    },
});
bebraw commented 1 year ago

Thanks a lot. I validated your fix and included it to 4.2.0.