Welcome to mirror list, hosted at ThFree Co, Russian Federation.

lch2lab.coffee « conversions « src « chroma-js « node_modules - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 735be27f4cc69f5e3331ce023771b4f84b5ad0b8 (plain)
1
2
3
4
5
6
7
8
9
10

lch2lab = () ->
    ###
    Convert from a qualitative parameter h and a quantitative parameter l to a 24-bit pixel. These formulas were invented by David Dalrymple to obtain maximum contrast without going out of gamut if the parameters are in the range 0-1.
    A saturation multiplier was added by Gregor Aisch
    ###
    [l,c,h] = unpack arguments
    h = h * Math.PI / 180
    [l, Math.cos(h) * c, Math.sin(h) * c]