{"version":3,"sources":["../src/color-spaces/HslColor.ts","../src/utilities/number-extension.ts","../src/color-spaces/LchColor.ts","../src/color-spaces/LabColor.ts","../src/color-spaces/XyzColor.ts","../src/color-spaces/RgbColor.ts","../src/GoldenPalette.ts","../src/constants/golden-palette.ts","../src/index.ts"],"names":["HslColor","hue","saturation","lightness","alpha","chroma","huePrime","x","m","RgbColor_default","angle","HslColor_default","maximumValue","minimumValue","LchColor","other","deltaLightness","meanLightness","meanChroma","aFactor","thisPrime","a","b","LabColor_default","otherPrime","deltaChromaPrime","meanChromaPrime","deltaHuePrime","deltaHPrime","meanHuePrime","t","sL","sC","sH","rT","newLightness","newChroma","newHue","block","LchColor_default","LabColor","fInv","y","z","XyzColor_default","value","delta","XyzColor","f","red","green","blue","RgbColor","redHex","greenHex","blueHex","max","min","calculator","GoldenPalette","colors","color","colorDeltaList","classColor","minDeltaOfColors","indexOfColorDeltaList","customBaseColor","maxLightness","closestGoldenPaletteColor","closestColorIndex","adjustMaxLightness","index","adjustedColor","GoldenPalette_default","goldenPalettes","createPrimaryPalette","hexColor","hexToRgbColor","toRgbColorOrNull","hslColor","createPalette","createComplementaryPalette","createAnalogousPalette","createTriadicPalette","lchColor","getClosestGoldenPalette","goldenPaletteMinDeltaList","goldenPalette","goldenPaletteMinDelta","indexOfGoldenPaletteMinDelta","rgbAsInt","rgbColor"],"mappings":"AAEA,IAAMA,EAAN,KAAe,CACb,YACUC,EACAC,EACAC,EACAC,EAAgB,EACxB,CAJQ,SAAAH,EACA,gBAAAC,EACA,eAAAC,EACA,WAAAC,CACP,CAEH,IAAI,oBAAqB,CACvB,OAAO,KAAK,UAAU,GAAG,CAC3B,CAEA,IAAI,gBAAiB,CACnB,MAAO,CAAC,KAAK,UAAU,GAAG,EAAG,KAAK,UAAU,EAAE,CAAC,CACjD,CAEA,IAAI,cAAe,CACjB,MAAO,CAAC,KAAK,UAAU,EAAE,EAAG,KAAK,UAAU,GAAG,CAAC,CACjD,CAEA,YAAuB,CACrB,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AW,EACb,IAAIA,EACF,kBACA,kBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,iBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,kBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,iBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,iBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,iBACA,kBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,iBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,kBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,iBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,iBACA,mBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,kBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,mBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,mBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,iBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,iBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,mBACA,kBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,iBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,mBACA,iBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,gBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,iBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,iBACA,iBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,iBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,gBACF,EAAE,WAAW,EACb,IAAIA,EACF,iBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,iBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,kBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,mBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,mBACA,iBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,uBACA,oBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,sBACA,oBACF,EAAE,WAAW,EACb,IAAIA,EACF,iBACA,sBACA,oBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,sBACA,oBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,sBACA,oBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,uBACA,oBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,sBACA,qBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,sBACA,qBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,sBACA,qBACF,EAAE,WAAW,EACb,IAAIA,EACF,mBACA,sBACA,qBACF,EAAE,WAAW,CACf,CAAC,EACD,IAAIkD,EAAc,CAChB,IAAIlD,EACF,kBACA,kBACA,kBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,oBACA,mBACF,EAAE,WAAW,EACb,IAAIA,EACF,kBACA,mBACA,iBACF,EAAE,WAA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B,EAA2BxB,GAAmC,CAClE,IAAMyB,EAA4BZ,EAAe,IAAIa,GAC5CA,EAAc,UAAU1B,CAAK,CACrC,EACK2B,EAAwB,KAAK,IAAI,GAAGF,CAAyB,EAC7DG,EAA+BH,EAA0B,QAC7DE,CACF,EAEA,OAAOd,EAAee,CAA4B,CACpD,EAEMX,EAAoBF,GAAqB,CAC7C,IAAMc,EAAW,SAASd,EAAU,EAAE,EAClCe,EAAW,KACf,GAAIf,EAAS,SAAW,EAAG,CACzB,IAAM3B,GAAQyC,GAAY,GAAM,KAAQ,IAClCxC,GAAUwC,GAAY,GAAM,KAAQ,IACpCvC,GAASuC,GAAY,EAAK,KAAQ,IAClCtF,GAASsF,EAAW,KAAc,IACxCC,EAAW,IAAIlF,EAASwC,EAAKC,EAAOC,EAAM/C,CAAK,EAGjD,GAAIwE,EAAS,SAAW,EAAG,CACzB,IAAM3B,GAAQyC,GAAY,GAAM,KAAQ,IAClCxC,GAAUwC,GAAY,EAAK,KAAQ,IACnCvC,GAAQuC,EAAW,KAAQ,IACjCC,EAAW,IAAIlF,EAASwC,EAAKC,EAAOC,CAAI,EAG1C,OAAOwC,CACT","sourcesContent":["import RgbColor from './RgbColor';\n\nclass HslColor {\n  constructor(\n    private hue: number,\n    private saturation: number,\n    private lightness: number,\n    private alpha: number = 1.0\n  ) {}\n\n  get complementaryColor() {\n    return this.harmonize(180);\n  }\n\n  get analogousColor() {\n    return [this.harmonize(330), this.harmonize(30)];\n  }\n\n  get triadicColor() {\n    return [this.harmonize(60), this.harmonize(120)];\n  }\n\n  toRgbColor(): RgbColor {\n    const { hue, saturation, lightness, alpha } = this;\n\n    const chroma = (1 - Math.abs(2.0 * lightness - 1.0)) * saturation;\n    const huePrime = hue / 60.0;\n    const x = chroma * (1 - Math.abs((huePrime % 2) - 1));\n    const m = lightness - chroma / 2.0;\n\n    if (huePrime < 1.0) {\n      return new RgbColor(chroma + m, x + m, m, alpha);\n    }\n    if (huePrime < 2.0) {\n      return new RgbColor(x + m, chroma + m, m, alpha);\n    }\n    if (huePrime < 3.0) {\n      return new RgbColor(m, chroma + m, x + m, alpha);\n    }\n    if (huePrime < 4.0) {\n      return new RgbColor(m, x + m, chroma + m, alpha);\n    }\n    if (huePrime < 5.0) {\n      return new RgbColor(x + m, m, chroma + m, alpha);\n    }\n    return new RgbColor(chroma + m, m, x + m, alpha);\n  }\n\n  // ref. https://dev.to/benjaminadk/make-color-math-great-again--45of\n  private harmonize(angle: number): HslColor {\n    const { hue, saturation, lightness, alpha } = this;\n\n    return new HslColor((hue + angle) % 360, saturation, lightness, alpha);\n  }\n}\n\nexport default HslColor;\n","declare global {\n  interface Number {\n    correctGamma(): number;\n  }\n}\n\nNumber.prototype.correctGamma = function (this: number): number {\n  if (this <= 0.04045) {\n    return this / 12.92;\n  }\n  return Math.pow((this + 0.055) / 1.055, 2.4);\n};\n\ndeclare global {\n  interface Number {\n    correctGamma(): number;\n    toDegrees(): number;\n  }\n}\n\nNumber.prototype.toDegrees = function (this: number): number {\n  return (this * 180) / Math.PI;\n};\n\ndeclare global {\n  interface Number {\n    toRadians(): number;\n  }\n}\n\nNumber.prototype.toRadians = function (this: number): number {\n  return (this * Math.PI) / 180.0;\n};\n\ndeclare global {\n  interface Number {\n    reverseGammaCorrection(): number;\n  }\n}\n\nNumber.prototype.reverseGammaCorrection = function (this: number): number {\n  if (this <= 0.0031308) {\n    return 12.92 * this;\n  }\n  return 1.055 * Math.pow(this, 1.0 / 2.4) - 0.055;\n};\n\ndeclare global {\n  interface Number {\n    coerceAtMost(maximumValue: number): number;\n  }\n}\n\nNumber.prototype.coerceAtMost = function (\n  this: number,\n  maximumValue: number\n): number {\n  if (this > maximumValue) {\n    return maximumValue;\n  }\n  return this;\n};\n\ndeclare global {\n  interface Number {\n    coerceAtLeast(minimumValue: number): number;\n  }\n}\n\nNumber.prototype.coerceAtLeast = function (\n  this: number,\n  minimumValue: number\n): number {\n  if (this < minimumValue) return minimumValue;\n\n  return this;\n};\n\ndeclare global {\n  interface Number {\n    coerceIn(minimumValue?: number, maximumValue?: number): number;\n  }\n}\n\nNumber.prototype.coerceIn = function (\n  this: number,\n  minimumValue?: number,\n  maximumValue?: number\n): number {\n  if (minimumValue != null && maximumValue != null) {\n    if (minimumValue > maximumValue)\n      throw new Error(\n        `Cannot coerce value to an empty range: maximum ${maximumValue} is less than minimum ${minimumValue}.`\n      );\n    if (this < minimumValue) return minimumValue;\n    if (this > maximumValue) return maximumValue;\n  }\n  if (minimumValue != null && this < minimumValue) return minimumValue;\n  if (maximumValue != null && this > maximumValue) return maximumValue;\n\n  return this;\n};\n\nexport default Number;\n","import LabColor from './LabColor';\nimport '../utilities/number-extension';\n\nclass LchColor {\n  constructor(\n    private lightness: number,\n    private chroma: number,\n    private hue: number,\n    private alpha: number = 1.0\n  ) {}\n\n  getLightness() {\n    return this.lightness;\n  }\n\n  getChroma() {\n    return this.chroma;\n  }\n\n  deltaE(other: LchColor): number {\n    const { lightness, chroma } = this;\n\n    const deltaLightness = lightness - other.lightness;\n    const meanLightness = (lightness + other.lightness) / 2.0;\n    const meanChroma = (chroma + other.chroma) / 2.0;\n    const aFactor =\n      1 -\n      Math.sqrt(\n        Math.pow(meanChroma, 7) / (Math.pow(meanChroma, 7) + Math.pow(25.0, 7))\n      );\n    const thisPrime = (() => {\n      const { lightness, a, b, alpha } = Object.assign(this.toLabColor());\n      const labColor = new LabColor(\n        lightness,\n        a + (a / 2.0) * aFactor,\n        b,\n        alpha\n      );\n      return labColor.toLchColor();\n    })();\n    const otherPrime = (() => {\n      const { lightness, a, b, alpha } = Object.assign(other.toLabColor());\n      const labColor = new LabColor(\n        lightness,\n        a + (a / 2.0) * aFactor,\n        b,\n        alpha\n      );\n      return labColor.toLchColor();\n    })();\n    const deltaChromaPrime = thisPrime.chroma - otherPrime.chroma;\n    const meanChromaPrime = (thisPrime.chroma + otherPrime.chroma) / 2.0;\n    const deltaHuePrime = thisPrime.hueDelta(otherPrime);\n    const deltaHPrime =\n      2.0 *\n      Math.sqrt(thisPrime.chroma * otherPrime.chroma) *\n      Math.sin((deltaHuePrime / 2.0).toRadians());\n    const meanHuePrime = thisPrime.meanHue(otherPrime);\n    const t =\n      1.0 -\n      0.17 * Math.cos((meanHuePrime - 30.0).toRadians()) +\n      0.24 * Math.cos((2.0 * meanHuePrime).toRadians()) +\n      0.32 * Math.cos((3.0 * meanHuePrime + 6.0).toRadians()) -\n      0.2 * Math.cos((4.0 * meanHuePrime - 63.0).toRadians());\n    const sL =\n      1.0 +\n      (0.015 * Math.pow(meanLightness - 50.0, 2)) /\n        Math.sqrt(20.0 + Math.pow(meanLightness - 50.0, 2));\n\n    const sC = 1.0 + 0.045 * meanChromaPrime;\n    const sH = 1.0 + 0.015 * meanChromaPrime * t;\n    const rT =\n      -2.0 *\n      Math.sqrt(\n        Math.pow(meanChromaPrime, 7) /\n          (Math.pow(meanChromaPrime, 7) + Math.pow(25, 7))\n      ) *\n      Math.sin(\n        (\n          60.0 * Math.exp(-Math.pow((meanHuePrime - 275.0) / 25.0, 2))\n        ).toRadians()\n      );\n    return Math.sqrt(\n      Math.pow(deltaLightness / sL, 2) +\n        Math.pow(deltaChromaPrime / sC, 2) +\n        Math.pow(deltaHPrime / sH, 2) +\n        rT * (deltaChromaPrime / sC) * (deltaHPrime / sH)\n    );\n  }\n\n  toLabColor(): LabColor {\n    const { lightness, chroma, hue, alpha } = this;\n\n    const a = chroma * Math.cos(hue.toRadians());\n    const b = chroma * Math.sin(hue.toRadians());\n    return new LabColor(lightness, a, b, alpha);\n  }\n\n  minus(other: LchColor) {\n    const newLightness = this.lightness - other.lightness;\n    const newChroma = this.chroma - other.chroma;\n    const newHue = this.hue - other.hue;\n    return new LchColor(newLightness, newChroma, newHue);\n  }\n\n  adjustLightness(block: (lightness: number) => number) {\n    const { lightness, chroma, hue, alpha } = this;\n\n    return new LchColor(block(lightness), chroma, hue, alpha);\n  }\n\n  adjustChroma(block: (chroma: number) => number) {\n    const { lightness, chroma, hue, alpha } = this;\n\n    return new LchColor(lightness, block(chroma), hue, alpha);\n  }\n\n  adjustHue(block: (hue: number) => number) {\n    const { lightness, chroma, hue, alpha } = this;\n\n    return new LchColor(lightness, chroma, block(hue), alpha);\n  }\n\n  private hueDelta(other: LchColor) {\n    const { hue } = this;\n\n    if (hue - other.hue >= -180.0 && hue - other.hue <= 180.0) {\n      return hue - other.hue;\n    }\n    if (hue <= other.hue) {\n      return hue - other.hue + 360.0;\n    }\n    return hue - other.hue - 360.0;\n  }\n\n  private meanHue(other: LchColor) {\n    const { hue } = this;\n\n    if (hue - other.hue >= -180.0 && hue - other.hue <= 180.0) {\n      return (other.hue + hue) / 2.0;\n    }\n    if (other.hue + hue < 360.0) {\n      return (other.hue + hue + 360.0) / 2.0;\n    }\n    return (other.hue + hue - 360.0) / 2.0;\n  }\n}\n\nexport default LchColor;\n","import LchColor from './LchColor';\nimport '../utilities/number-extension';\nimport XyzColor from './XyzColor';\n\nclass LabColor {\n  constructor(\n    private lightness: number,\n    private a: number,\n    private b: number,\n    private alpha: number = 1.0\n  ) {}\n\n  toLchColor(): LchColor {\n    const { lightness, a, b, alpha } = this;\n\n    const chroma = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n    const hue = () => {\n      if (1e-4 > Math.abs(b) && 1e-4 > Math.abs(a)) {\n        return 0;\n      }\n      return (Math.atan2(b, a).toDegrees() + 360.0) % 360.0;\n    };\n    return new LchColor(lightness, chroma, hue(), alpha);\n  }\n\n  toXyzColor() {\n    const { lightness, a, b, alpha, fInv } = this;\n\n    const x = 0.95047 * fInv((lightness + 16.0) / 116.0 + a / 500.0);\n    const y = 1 * fInv((lightness + 16.0) / 116.0);\n    const z = 1.08883 * fInv((lightness + 16.0) / 116.0 - b / 200.0);\n\n    return new XyzColor(x, y, z, alpha);\n  }\n\n  private fInv(value: number): number {\n    const delta = 6.0 / 29.0;\n\n    if (value > delta) {\n      return Math.pow(value, 3);\n    }\n    return 3.0 * Math.pow(delta, 2) * (value - 4.0 / 29.0);\n  }\n}\n\nexport default LabColor;\n","import LabColor from './LabColor';\nimport RgbColor from './RgbColor';\n\nclass XyzColor {\n  constructor(\n    private x: number,\n    private y: number,\n    private z: number,\n    private alpha: number = 1\n  ) {}\n\n  toLabColor(): LabColor {\n    const { x, y, z, alpha, f } = this;\n\n    const lightness = 116.0 * f(y) - 16;\n    const a = 500.0 * (f(x / 0.95047) - f(y));\n    const b = 200.0 * (f(y) - f(z / 1.08883));\n    return new LabColor(lightness, a, b, alpha);\n  }\n\n  toRgbColor(): RgbColor {\n    const { x, y, z, alpha } = this;\n\n    const red = (3.2404542 * x + -1.5371385 * y + -0.4985314 * z)\n      .reverseGammaCorrection()\n      .coerceIn(0.0, 1.0);\n    const green = (-0.969266 * x + 1.8760108 * y + 0.041556 * z)\n      .reverseGammaCorrection()\n      .coerceIn(0.0, 1.0);\n    const blue = (0.0556434 * x + -0.2040259 * y + 1.0572252 * z)\n      .reverseGammaCorrection()\n      .coerceIn(0.0, 1.0);\n\n    return new RgbColor(red, green, blue, alpha);\n  }\n\n  private f(value: number): number {\n    const delta = 6.0 / 29.0;\n\n    if (value > Math.pow(delta, 3)) {\n      return Math.pow(value, 1.0 / 3.0);\n    }\n    return value / (3.0 * Math.pow(delta, 2)) + 4.0 / 29.0;\n  }\n}\n\nexport default XyzColor;\n","import HslColor from './HslColor';\nimport LchColor from './LchColor';\nimport XyzColor from './XyzColor';\n\nclass RgbColor {\n  constructor(\n    private red: number,\n    private green: number,\n    private blue: number,\n    private alpha: number = 1.0\n  ) {}\n\n  get rgbHex(): string {\n    const { red, green, blue } = this;\n    const redHex = Math.round(red * 0xff)\n      .toString(16)\n      .padStart(2, '0');\n    const greenHex = Math.round(green * 0xff)\n      .toString(16)\n      .padStart(2, '0');\n    const blueHex = Math.round(blue * 0xff)\n      .toString(16)\n      .padStart(2, '0');\n\n    return `${redHex}${greenHex}${blueHex}`.toUpperCase();\n  }\n\n  toLchColor(): LchColor {\n    return this.toHslColor()\n      .toRgbColor()\n      .toXyzColor()\n      .toLabColor()\n      .toLchColor();\n  }\n\n  toHslColor(): HslColor {\n    const max = Math.max(this.red, this.green, this.blue);\n    const min = Math.min(this.red, this.green, this.blue);\n    const delta = max - min;\n\n    const hue = () => {\n      const calculator = (value: number) =>\n        Math.round((60.0 * value + 360.0) % 360.0);\n      if (delta == 0) {\n        return 0;\n      }\n      if (max == this.red) {\n        return calculator((this.green - this.blue) / delta);\n      }\n      if (max == this.green) {\n        return calculator((this.blue - this.red) / delta + 2);\n      }\n      return calculator((this.red - this.green) / delta + 4);\n    };\n\n    const saturation = () => {\n      if (max == 0.0 || min == 1.0) return 0.0;\n      return delta / (1 - Math.abs(max + min - 1));\n    };\n\n    const lightness = (max + min) / 2.0;\n\n    return new HslColor(hue(), saturation(), lightness, this.alpha);\n  }\n\n  toXyzColor(): XyzColor {\n    const { red, green, blue, alpha } = this;\n    const x =\n      0.4124564 * red.correctGamma() +\n      0.3575761 * green.correctGamma() +\n      0.1804375 * blue.correctGamma();\n    const y =\n      0.2126729 * red.correctGamma() +\n      0.7151522 * green.correctGamma() +\n      0.072175 * blue.correctGamma();\n    const z =\n      0.0193339 * red.correctGamma() +\n      0.119192 * green.correctGamma() +\n      0.9503041 * blue.correctGamma();\n    return new XyzColor(x, y, z, alpha);\n  }\n}\n\nexport default RgbColor;\n","import LchColor from './color-spaces/LchColor';\nimport './utilities/number-extension';\n\nclass GoldenPalette {\n  constructor(private colors: LchColor[]) {}\n\n  minDeltaE(color: LchColor): number {\n    const colorDeltaList = this.colors.map(classColor =>\n      color.deltaE(classColor)\n    );\n    return Math.min(...colorDeltaList);\n  }\n\n  getClosestColor(color: LchColor): LchColor {\n    const colorDeltaList = this.colors.map(classColor =>\n      color.deltaE(classColor)\n    );\n    const minDeltaOfColors = Math.min(...colorDeltaList);\n    const indexOfColorDeltaList = colorDeltaList.indexOf(minDeltaOfColors);\n    return this.colors[indexOfColorDeltaList];\n  }\n\n  createCustomPalette(customBaseColor: LchColor): LchColor[] {\n    let maxLightness = 100.0;\n\n    const closestGoldenPaletteColor = this.getClosestColor(customBaseColor);\n    const closestColorIndex = this.colors.indexOf(closestGoldenPaletteColor);\n    const adjustMaxLightness = (color: LchColor) =>\n      (color.getLightness() - 1.7).coerceAtLeast(0.0);\n\n    return this.colors.map((color, index) => {\n      if (color === closestGoldenPaletteColor) {\n        maxLightness = adjustMaxLightness(customBaseColor);\n        return customBaseColor;\n      }\n\n      const adjustedColor = color\n        .minus(\n          closestGoldenPaletteColor\n            .minus(customBaseColor)\n            .adjustLightness(\n              (lightness: number) =>\n                lightness *\n                (this.lightnessFactors[index] /\n                  this.lightnessFactors[closestColorIndex])\n            )\n            .adjustChroma(\n              (chroma: number) =>\n                chroma *\n                (this.hasMainColorLowChroma()\n                  ? 1.0\n                  : (\n                      this.chromaFactors[index] /\n                      this.chromaFactors[closestColorIndex]\n                    ).coerceAtMost(1.25))\n            )\n        )\n        .adjustLightness((lightness: number) =>\n          lightness.coerceIn(0.0, maxLightness)\n        )\n        .adjustChroma((chroma: number) => chroma.coerceAtLeast(0.0))\n        .adjustHue((hue: number) => (hue + 360.0) % 360);\n\n      maxLightness = adjustMaxLightness(adjustedColor);\n      return adjustedColor;\n    });\n  }\n\n  hasMainColorLowChroma() {\n    return this.colors[5].getChroma() < 30;\n  }\n\n  private lightnessFactors = [\n    2.048875457, 5.124792061, 8.751659557, 12.07628774, 13.91449542,\n    15.92738893, 15.46585818, 15.09779227, 15.13738673, 15.09818372,\n  ];\n\n  private chromaFactors = [\n    1.762442714, 4.213532634, 7.395827458, 11.07174158, 13.89634504,\n    16.37591477, 16.27071136, 16.54160806, 17.35916727, 19.88410864,\n  ];\n}\n\nexport default GoldenPalette;\n","import LabColor from '../color-spaces/LabColor';\nimport GoldenPalette from '../GoldenPalette';\n\nexport const goldenPalettes = [\n  new GoldenPalette([\n    new LabColor(\n      94.67497003305085,\n      7.266715066863771,\n      1.000743882272359\n    ).toLchColor(),\n    new LabColor(\n      86.7897416761699,\n      18.370736761658012,\n      4.23637133971424\n    ).toLchColor(),\n    new LabColor(\n      72.0939162832561,\n      31.7948058298117,\n      13.2972443996896\n    ).toLchColor(),\n    new LabColor(\n      61.79353370051851,\n      44.129498163764545,\n      20.721477326799608\n    ).toLchColor(),\n    new LabColor(\n      57.194195398949574,\n      59.6450006197361,\n      34.999830012940194\n    ).toLchColor(),\n    new LabColor(\n      55.603951071861374,\n      66.01287384845483,\n      47.67169313982772\n    ).toLchColor(),\n    new LabColor(\n      51.66348502954747,\n      64.7487785020625,\n      43.244876694855286\n    ).toLchColor(),\n    new LabColor(\n      47.09455666350969,\n      62.29836039074277,\n      40.67775424698388\n    ).toLchColor(),\n    new LabColor(\n      43.77122063388739,\n      60.28633509183384,\n      40.31444686692952\n    ).toLchColor(),\n    new LabColor(\n      39.555187078007386,\n      58.703681355389975,\n      41.66495027798629\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      92.68053776327665,\n      9.515385232804263,\n      -0.8994072969754852\n    ).toLchColor(),\n    new LabColor(\n      81.86756643628922,\n      25.05688089723257,\n      -1.9475235115390621\n    ).toLchColor(),\n    new LabColor(\n      70.90987389545768,\n      42.21705257720526,\n      -1.095154624057959\n    ).toLchColor(),\n    new LabColor(\n      61.08140805216186,\n      58.871233307587204,\n      2.1008764804626434\n    ).toLchColor(),\n    new LabColor(\n      54.97970219986448,\n      68.56530938366889,\n      7.327430728560569\n    ).toLchColor(),\n    new LabColor(\n      50.872250340749176,\n      74.60459195925529,\n      15.353576256896073\n    ).toLchColor(),\n    new LabColor(\n      47.27738650144558,\n      70.77855776427805,\n      11.70434273264508\n    ).toLchColor(),\n    new LabColor(\n      42.58424189486517,\n      65.5411953138309,\n      7.595596439803797\n    ).toLchColor(),\n    new LabColor(\n      37.977492407254836,\n      60.74362621842075,\n      2.9847124951453474\n    ).toLchColor(),\n    new LabColor(\n      29.699290034849604,\n      51.90485023721311,\n      -4.830186634107636\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      92.4362655169016,\n      7.542927467702299,\n      -6.039842848605881\n    ).toLchColor(),\n    new LabColor(\n      81.07399776904751,\n      19.563870217805036,\n      -15.719625491986044\n    ).toLchColor(),\n    new LabColor(\n      68.71394717711831,\n      33.79992812490556,\n      -26.49539972339321\n    ).toLchColor(),\n    new LabColor(\n      56.596161226236305,\n      47.5856631835152,\n      -36.480816605410915\n    ).toLchColor(),\n    new LabColor(\n      48.002791217624434,\n      57.30866443934879,\n      -43.2561127152548\n    ).toLchColor(),\n    new LabColor(\n      40.66211534692161,\n      64.01910773818436,\n      -48.05930162591041\n    ).toLchColor(),\n    new LabColor(\n      37.690702208992185,\n      61.13762767732481,\n      -49.384803274243026\n    ).toLchColor(),\n    new LabColor(\n      33.56291870731981,\n      57.637381239254104,\n      -51.39557249855828\n    ).toLchColor(),\n    new LabColor(\n      29.865391314234515,\n      54.29737439901333,\n      -52.6601973712463\n    ).toLchColor(),\n    new LabColor(\n      23.16724235420436,\n      48.51764437280498,\n      -55.16267949015293\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      92.49103426017201,\n      4.712320025752947,\n      -6.532868071709763\n    ).toLchColor(),\n    new LabColor(\n      81.24668319505597,\n      11.50642734909485,\n      -16.666600637245367\n    ).toLchColor(),\n    new LabColor(\n      68.61488216554629,\n      20.395329051982824,\n      -28.522018851715416\n    ).toLchColor(),\n    new LabColor(\n      55.60369793053023,\n      30.933537768905005,\n      -41.16439122358484\n    ).toLchColor(),\n    new LabColor(\n      45.834566190969426,\n      39.28806272235674,\n      -50.523322052772635\n    ).toLchColor(),\n    new LabColor(\n      36.608620229358664,\n      47.29686002828143,\n      -59.111766586186846\n    ).toLchColor(),\n    new LabColor(\n      34.189791237562616,\n      46.60426065139123,\n      -59.53961627676729\n    ).toLchColor(),\n    new LabColor(\n      30.52713367338361,\n      46.01498224754519,\n      -60.19975052509064\n    ).toLchColor(),\n    new LabColor(\n      27.44585524877222,\n      44.96180431854785,\n      -60.46395810756433\n    ).toLchColor(),\n    new LabColor(\n      21.98627670328218,\n      44.29296076245473,\n      -60.93653655172098\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      92.86314411983918,\n      1.5318147061061937,\n      -6.025243528950552\n    ).toLchColor(),\n    new LabColor(\n      81.8348073705298,\n      4.460934955458907,\n      -15.873561009736136\n    ).toLchColor(),\n    new LabColor(\n      69.7796913795672,\n      7.9043652558912765,\n      -26.3170846346932\n    ).toLchColor(),\n    new LabColor(\n      57.48786519938736,\n      12.681019504822533,\n      -37.23202012914528\n    ).toLchColor(),\n    new LabColor(\n      47.74592578811101,\n      18.520799302452374,\n      -46.47540679000397\n    ).toLchColor(),\n    new LabColor(\n      38.334403614455404,\n      25.57700668170812,\n      -55.28224153299287\n    ).toLchColor(),\n    new LabColor(\n      35.15116453901552,\n      26.231812080381168,\n      -54.53700978785404\n    ).toLchColor(),\n    new LabColor(\n      31.080429988007957,\n      27.07394930110124,\n      -53.97505274579958\n    ).toLchColor(),\n    new LabColor(\n      27.026672080454922,\n      28.165266427558983,\n      -53.28987325482218\n    ).toLchColor(),\n    new LabColor(\n      19.751201587921678,\n      30.60784576895101,\n      -52.13866519297474\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      94.70682457348717,\n      -2.835484735987326,\n      -6.978044694792707\n    ).toLchColor(),\n    new LabColor(\n      86.8839842970016,\n      -5.16908728759552,\n      -17.88561192754956\n    ).toLchColor(),\n    new LabColor(\n      79.0451532401558,\n      -6.817753527015746,\n      -28.968537490432176\n    ).toLchColor(),\n    new LabColor(\n      71.15083697242613,\n      -5.994763756850707,\n      -39.72549451158927\n    ).toLchColor(),\n    new LabColor(\n      65.48106058907833,\n      -2.735745792537936,\n      -48.15471238926561\n    ).toLchColor(),\n    new LabColor(\n      60.43009440850862,\n      2.079928897321559,\n      -55.10935847069616\n    ).toLchColor(),\n    new LabColor(\n      55.62267676922188,\n      4.998684384486918,\n      -55.02164729429915\n    ).toLchColor(),\n    new LabColor(\n      49.27006645904875,\n      8.470398370314381,\n      -54.494796838457546\n    ).toLchColor(),\n    new LabColor(\n      43.16828856394358,\n      11.968483076143844,\n      -53.972567377977974\n    ).toLchColor(),\n    new LabColor(\n      32.17757793894193,\n      18.96054990229354,\n      -53.45146365049088\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      95.35713467762652,\n      -4.797149155388203,\n      -6.550002550504308\n    ).toLchColor(),\n    new LabColor(\n      88.27942649540043,\n      -10.836006614583892,\n      -16.359361821940375\n    ).toLchColor(),\n    new LabColor(\n      81.10009044900976,\n      -15.323054522981716,\n      -26.419121191320947\n    ).toLchColor(),\n    new LabColor(\n      74.44713958259777,\n      -16.664432625362547,\n      -35.19702686900037\n    ).toLchColor(),\n    new LabColor(\n      69.87836465637318,\n      -14.291515332054693,\n      -41.827430329755174\n    ).toLchColor(),\n    new LabColor(\n      65.68851259178913,\n      -9.612635721963692,\n      -47.34091616039191\n    ).toLchColor(),\n    new LabColor(\n      60.88357994308973,\n      -7.252819027184943,\n      -46.67753731595634\n    ).toLchColor(),\n    new LabColor(\n      54.26166495426166,\n      -3.8141836897908066,\n      -45.97939475762498\n    ).toLchColor(),\n    new LabColor(\n      48.10661895072673,\n      -1.378998784464347,\n      -44.34466750206778\n    ).toLchColor(),\n    new LabColor(\n      36.34401147057282,\n      5.067812404713545,\n      -43.11786257561915\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      95.69295154599753,\n      -6.898716127301141,\n      -3.994284229654421\n    ).toLchColor(),\n    new LabColor(\n      89.52842524059004,\n      -16.412398289601725,\n      -9.260466069266693\n    ).toLchColor(),\n    new LabColor(\n      83.32031214655748,\n      -24.83036840728098,\n      -14.568673583304603\n    ).toLchColor(),\n    new LabColor(\n      77.35338313752958,\n      -30.201708572215104,\n      -18.92358284721101\n    ).toLchColor(),\n    new LabColor(\n      73.45322093857781,\n      -31.88590390189383,\n      -21.130459992513686\n    ).toLchColor(),\n    new LabColor(\n      69.97638465064783,\n      -30.679850324547953,\n      -23.186685661136707\n    ).toLchColor(),\n    new LabColor(\n      64.44491716553777,\n      -29.08337434584457,\n      -21.154935769156214\n    ).toLchColor(),\n    new LabColor(\n      56.99816432961103,\n      -27.31081477279451,\n      -17.86988815767443\n    ).toLchColor(),\n    new LabColor(\n      49.75464182255671,\n      -25.335383503694242,\n      -15.024722591662787\n    ).toLchColor(),\n    new LabColor(\n      36.52725894264432,\n      -22.129641744194515,\n      -9.176159146894303\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      94.18453941589918,\n      -6.08351703428972,\n      -1.5488916051161983\n    ).toLchColor(),\n    new LabColor(\n      85.68177077414457,\n      -15.333179440298606,\n      -2.8519825761476048\n    ).toLchColor(),\n    new LabColor(\n      76.85067847190405,\n      -24.844059173189713,\n      -3.8750785132192656\n    ).toLchColor(),\n    new LabColor(\n      68.02762242570138,\n      -32.566861154120716,\n      -4.015231084407134\n    ).toLchColor(),\n    new LabColor(\n      61.667257304525464,\n      -36.06752603289354,\n      -3.4734046401753815\n    ).toLchColor(),\n    new LabColor(\n      55.67310397390196,\n      -36.66069960626328,\n      -2.125617915169653\n    ).toLchColor(),\n    new LabColor(\n      51.059149495197715,\n      -34.65019160301408,\n      -1.3910484300432513\n    ).toLchColor(),\n    new LabColor(\n      45.269081019218405,\n      -32.13244775422941,\n      -0.4526371852697775\n    ).toLchColor(),\n    new LabColor(\n      39.36899076059384,\n      -29.25264468583161,\n      -0.03562564673170732\n    ).toLchColor(),\n    new LabColor(\n      28.58363043701477,\n      -24.585465516136413,\n      1.8037402162492389\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      95.30530183565223,\n      -6.430415645739263,\n      4.292950594459599\n    ).toLchColor(),\n    new LabColor(\n      88.49014579152143,\n      -15.23147744952702,\n      10.848261177683138\n    ).toLchColor(),\n    new LabColor(\n      81.22616870575376,\n      -24.993886168551583,\n      18.144696803330884\n    ).toLchColor(),\n    new LabColor(\n      74.30361721558802,\n      -35.56088696067356,\n      26.781515251907727\n    ).toLchColor(),\n    new LabColor(\n      69.0430995277442,\n      -42.61556126595995,\n      33.17109563126665\n    ).toLchColor(),\n    new LabColor(\n      63.977421814072926,\n      -48.54292673319982,\n      39.73241526342939\n    ).toLchColor(),\n    new LabColor(\n      58.777960853461366,\n      -46.1153692478013,\n      37.838910745225576\n    ).toLchColor(),\n    new LabColor(\n      52.41108688974904,\n      -43.21761792485762,\n      35.62250659009424\n    ).toLchColor(),\n    new LabColor(\n      46.2813873076426,\n      -40.25816227675361,\n      33.32343229338761\n    ).toLchColor(),\n    new LabColor(\n      34.685655305814514,\n      -34.75343878510312,\n      28.866739034359767\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      96.70518169355954,\n      -4.929987845095463,\n      6.397084523168894\n    ).toLchColor(),\n    new LabColor(\n      91.66416061199438,\n      -12.057032041945693,\n      16.054604579275143\n    ).toLchColor(),\n    new LabColor(\n      86.2244395865449,\n      -19.613646834080622,\n      26.384906423454236\n    ).toLchColor(),\n    new LabColor(\n      80.83404879636919,\n      -27.080171840756893,\n      37.378493742021334\n    ).toLchColor(),\n    new LabColor(\n      76.79543725108964,\n      -32.76659719736752,\n      45.912190572444445\n    ).toLchColor(),\n    new LabColor(\n      72.90025297028019,\n      -37.549139223927384,\n      53.51959496103027\n    ).toLchColor(),\n    new LabColor(\n      67.21532310272079,\n      -36.56304870773486,\n      50.49629051268894\n    ).toLchColor(),\n    new LabColor(\n      59.91051142210195,\n      -35.77011466063357,\n      46.56465847976187\n    ).toLchColor(),\n    new LabColor(\n      52.51015841084511,\n      -34.47903440699235,\n      42.20723868724268\n    ).toLchColor(),\n    new LabColor(\n      39.41191983353878,\n      -32.80460974352642,\n      35.255490585630014\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      97.99506057883428,\n      -4.059632482741494,\n      9.355797602381521\n    ).toLchColor(),\n    new LabColor(\n      94.80926235976536,\n      -9.237091467352855,\n      23.230650064824985\n    ).toLchColor(),\n    new LabColor(\n      91.85205843526167,\n      -15.053917327011114,\n      38.86115182206598\n    ).toLchColor(),\n    new LabColor(\n      88.75812142080242,\n      -19.542900400164097,\n      53.71785675783709\n    ).toLchColor(),\n    new LabColor(\n      86.27404180729515,\n      -22.173992891121596,\n      63.978639065232514\n    ).toLchColor(),\n    new LabColor(\n      84.20566835376492,\n      -24.270643520989342,\n      72.79624067033038\n    ).toLchColor(),\n    new LabColor(\n      78.27915100603997,\n      -21.181850056402496,\n      68.82763412297965\n    ).toLchColor(),\n    new LabColor(\n      70.82385811892824,\n      -17.788148932525672,\n      64.00327817988128\n    ).toLchColor(),\n    new LabColor(\n      62.936867012868035,\n      -13.697412111684903,\n      58.513000509287835\n    ).toLchColor(),\n    new LabColor(\n      49.498610881452535,\n      -6.485230564384715,\n      49.67432722833751\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      98.93885129752759,\n      -3.0098470288543178,\n      10.765736833790008\n    ).toLchColor(),\n    new LabColor(\n      97.22689784824074,\n      -6.174599368734491,\n      26.22932417355146\n    ).toLchColor(),\n    new LabColor(\n      95.58092947828766,\n      -8.907132848473886,\n      43.56297291446567\n    ).toLchColor(),\n    new LabColor(\n      94.09009515702486,\n      -10.509628942710735,\n      60.20019514231188\n    ).toLchColor(),\n    new LabColor(\n      93.06546746683087,\n      -11.008558476013008,\n      71.76500826005477\n    ).toLchColor(),\n    new LabColor(\n      92.12975017760128,\n      -10.830023094868302,\n      80.9090559640089\n    ).toLchColor(),\n    new LabColor(\n      87.12188349168609,\n      -2.3764300099239355,\n      78.14868195373407\n    ).toLchColor(),\n    new LabColor(\n      80.96200442419905,\n      8.849333792729064,\n      75.05050700092679\n    ).toLchColor(),\n    new LabColor(\n      75.00342770718086,\n      20.340173566879283,\n      72.24841925958934\n    ).toLchColor(),\n    new LabColor(\n      65.48207757431567,\n      39.647064970476094,\n      68.34872841768654\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      97.5642392074337,\n      -1.445525639405032,\n      11.881254316297674\n    ).toLchColor(),\n    new LabColor(\n      93.67057953749456,\n      -1.8693096862072434,\n      30.02888670415651\n    ).toLchColor(),\n    new LabColor(\n      89.94571492804107,\n      -1.0224503814769692,\n      49.649542361642276\n    ).toLchColor(),\n    new LabColor(\n      86.71009164153801,\n      1.0496066396428194,\n      68.77377342409739\n    ).toLchColor(),\n    new LabColor(\n      83.78773993319211,\n      5.248231820098425,\n      78.92920457852716\n    ).toLchColor(),\n    new LabColor(\n      81.52191382080228,\n      9.403655370707199,\n      82.69257112982746\n    ).toLchColor(),\n    new LabColor(\n      78.17240973804697,\n      16.628512886531887,\n      81.09358318806208\n    ).toLchColor(),\n    new LabColor(\n      73.80899654381052,\n      26.53614315250874,\n      78.21754052181723\n    ).toLchColor(),\n    new LabColor(\n      70.1134511665764,\n      35.3007623359744,\n      75.87510992138593\n    ).toLchColor(),\n    new LabColor(\n      63.86460405565717,\n      50.94648214505959,\n      72.17815682124423\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      96.30459517801387,\n      0.923151172282477,\n      10.598439446083074\n    ).toLchColor(),\n    new LabColor(\n      90.68320082865087,\n      4.103774964681062,\n      26.485793721916128\n    ).toLchColor(),\n    new LabColor(\n      85.00055287186233,\n      9.047181758866651,\n      44.51407622580792\n    ).toLchColor(),\n    new LabColor(\n      79.42428495742953,\n      16.452610724439875,\n      62.08721739074201\n    ).toLchColor(),\n    new LabColor(\n      75.47792699289774,\n      23.395742928451867,\n      72.64347611236501\n    ).toLchColor(),\n    new LabColor(\n      72.04246561548388,\n      30.681921012382098,\n      77.08579298904603\n    ).toLchColor(),\n    new LabColor(\n      68.94724338946975,\n      35.22014778433863,\n      74.88425044595111\n    ).toLchColor(),\n    new LabColor(\n      64.83017495535229,\n      40.91200730099703,\n      71.9596053545428\n    ).toLchColor(),\n    new LabColor(\n      60.8534207471871,\n      46.41483590510681,\n      69.18061963415211\n    ).toLchColor(),\n    new LabColor(\n      54.77571742962287,\n      55.282751019360035,\n      65.10193403547922\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      93.69219844671957,\n      5.763979334358293,\n      3.1700162796469034\n    ).toLchColor(),\n    new LabColor(\n      86.04629434276428,\n      15.750843803958192,\n      14.828476927090994\n    ).toLchColor(),\n    new LabColor(\n      77.54010042938336,\n      27.90113842540043,\n      25.99645229289065\n    ).toLchColor(),\n    new LabColor(\n      69.74095456707857,\n      41.14487377552256,\n      39.443320178900024\n    ).toLchColor(),\n    new LabColor(\n      64.37085344539341,\n      51.890379620443575,\n      50.81312471046415\n    ).toLchColor(),\n    new LabColor(\n      60.06780837277435,\n      61.65258736118817,\n      61.54771829165221\n    ).toLchColor(),\n    new LabColor(\n      57.28707915232363,\n      60.3250664308812,\n      60.07341536376447\n    ).toLchColor(),\n    new LabColor(\n      53.810052616293845,\n      58.36760943780162,\n      58.19586806694884\n    ).toLchColor(),\n    new LabColor(\n      50.301352405105874,\n      56.40104898089937,\n      55.924141992404344\n    ).toLchColor(),\n    new LabColor(\n      43.86477994548343,\n      52.970887703910726,\n      52.30067989225532\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      93.29864888069987,\n      0.9915456090475727,\n      1.442353076378411\n    ).toLchColor(),\n    new LabColor(\n      82.80884359004081,\n      3.116221903342209,\n      3.3523059451463055\n    ).toLchColor(),\n    new LabColor(\n      70.95493047668185,\n      5.469742193344784,\n      5.449009494553492\n    ).toLchColor(),\n    new LabColor(\n      58.712934619103066,\n      7.990991075363385,\n      8.352488495367627\n    ).toLchColor(),\n    new LabColor(\n      49.150208552875895,\n      10.570984981000397,\n      10.831440151197924\n    ).toLchColor(),\n    new LabColor(\n      39.63200151837749,\n      13.138881961627241,\n      13.531574711511885\n    ).toLchColor(),\n    new LabColor(\n      35.600996682015754,\n      12.40352847757295,\n      12.10432183902449\n    ).toLchColor(),\n    new LabColor(\n      30.084271265759952,\n      11.317148149878081,\n      10.547484304296217\n    ).toLchColor(),\n    new LabColor(\n      24.555014696416578,\n      10.816613316782464,\n      8.506555306791984\n    ).toLchColor(),\n    new LabColor(\n      18.35055226514404,\n      10.225725550338765,\n      7.058582769882571\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      98.27202740980219,\n      -1.6418393644634932e-5,\n      6.567357457853973e-6\n    ).toLchColor(),\n    new LabColor(\n      96.53749336548567,\n      -1.616917905122861e-5,\n      6.467671598286984e-6\n    ).toLchColor(),\n    new LabColor(\n      94.0978378987781,\n      -1.581865383126768e-5,\n      6.327461532507073e-6\n    ).toLchColor(),\n    new LabColor(\n      89.17728373493613,\n      -1.511167768697419e-5,\n      6.044671074789676e-6\n    ).toLchColor(),\n    new LabColor(\n      76.61119902231323,\n      -1.330620591488696e-5,\n      5.322482343750323e-6\n    ).toLchColor(),\n    new LabColor(\n      65.11424774127516,\n      -1.1654345155598378e-5,\n      4.661738062239351e-6\n    ).toLchColor(),\n    new LabColor(\n      49.238989620828065,\n      -9.373417431124409e-6,\n      3.7493669724497636e-6\n    ).toLchColor(),\n    new LabColor(\n      41.14266843804848,\n      -8.210152946386273e-6,\n      3.2840611896567395e-6\n    ).toLchColor(),\n    new LabColor(\n      27.974857206003705,\n      -6.318226192236764e-6,\n      2.5272904768947058e-6\n    ).toLchColor(),\n    new LabColor(\n      12.740011331302725,\n      -4.129311698131133e-6,\n      1.6517246792524531e-6\n    ).toLchColor(),\n  ]),\n  new GoldenPalette([\n    new LabColor(\n      94.27665212516236,\n      -0.637571046109342,\n      -1.313515378996688\n    ).toLchColor(),\n    new LabColor(\n      85.77788001492097,\n      -2.2777811084512822,\n      -3.0177758416151557\n    ).toLchColor(),\n    new LabColor(\n      76.12296325015231,\n      -3.401502988883809,\n      -5.16867892977908\n    ).toLchColor(),\n    new LabColor(\n      66.16340108908365,\n      -4.819627183079045,\n      -7.520697631614404\n    ).toLchColor(),\n    new LabColor(\n      58.35752478513645,\n      -5.7195089100892105,\n      -9.165988916613488\n    ).toLchColor(),\n    new LabColor(\n      50.70748082202715,\n      -6.837992965799455,\n      -10.956055112409357\n    ).toLchColor(),\n    new LabColor(\n      44.85917867647632,\n      -6.411990559239578,\n      -9.74511982878765\n    ).toLchColor(),\n    new LabColor(\n      36.92458930566504,\n      -5.319878610845596,\n      -8.341943474561553\n    ).toLchColor(),\n    new LabColor(\n      29.115334784637618,\n      -4.168907828645069,\n      -6.8629962199973304\n    ).toLchColor(),\n    new LabColor(\n      19.958338450799914,\n      -3.3116721453186617,\n      -5.4486142104736786\n    ).toLchColor(),\n  ]),\n];\n","import HslColor from './color-spaces/HslColor';\nimport LchColor from './color-spaces/LchColor';\nimport RgbColor from './color-spaces/RgbColor';\nimport { goldenPalettes } from './constants/golden-palette';\nimport GoldenPalette from './GoldenPalette';\n\nconst createPrimaryPalette = (hexColor: string): RgbColor[] | null => {\n  const hexToRgbColor = toRgbColorOrNull(hexColor);\n  if (hexToRgbColor == null) {\n    return null;\n  }\n\n  const hslColor = hexToRgbColor.toHslColor();\n\n  return createPalette(hslColor);\n};\n\nconst createComplementaryPalette = (hexColor: string): RgbColor[] | null => {\n  const hexToRgbColor = toRgbColorOrNull(hexColor);\n  if (hexToRgbColor == null) {\n    return null;\n  }\n\n  const hslColor = hexToRgbColor.toHslColor().complementaryColor;\n\n  return createPalette(hslColor);\n};\n\nconst createAnalogousPalette = (hexColor: string): RgbColor[][] | null => {\n  const hexToRgbColor = toRgbColorOrNull(hexColor);\n  if (hexToRgbColor == null) {\n    return null;\n  }\n\n  const hslColors = hexToRgbColor.toHslColor().analogousColor;\n\n  return hslColors.map(hslColor => createPalette(hslColor));\n};\n\nconst createTriadicPalette = (hexColor: string): RgbColor[][] | null => {\n  const hexToRgbColor = toRgbColorOrNull(hexColor);\n  if (hexToRgbColor == null) {\n    return null;\n  }\n\n  const hslColors = hexToRgbColor.toHslColor().triadicColor;\n\n  return hslColors.map(hslColor => createPalette(hslColor));\n};\n\nconst createPalette = (hslColor: HslColor): RgbColor[] => {\n  const lchColor = hslColor.toRgbColor().toXyzColor().toLabColor().toLchColor();\n\n  const customPalette =\n    getClosestGoldenPalette(lchColor).createCustomPalette(lchColor);\n\n  const customPaletteAsRgb = customPalette.map(color =>\n    color.toLabColor().toXyzColor().toRgbColor()\n  );\n\n  return customPaletteAsRgb;\n};\n\nconst getClosestGoldenPalette = (color: LchColor): GoldenPalette => {\n  const goldenPaletteMinDeltaList = goldenPalettes.map(goldenPalette => {\n    return goldenPalette.minDeltaE(color);\n  });\n  const goldenPaletteMinDelta = Math.min(...goldenPaletteMinDeltaList);\n  const indexOfGoldenPaletteMinDelta = goldenPaletteMinDeltaList.indexOf(\n    goldenPaletteMinDelta\n  );\n\n  return goldenPalettes[indexOfGoldenPaletteMinDelta];\n};\n\nconst toRgbColorOrNull = (hexColor: string) => {\n  const rgbAsInt = parseInt(hexColor, 16);\n  let rgbColor = null;\n  if (hexColor.length === 8) {\n    const red = ((rgbAsInt >> 24) & 0xff) / 255;\n    const green = ((rgbAsInt >> 16) & 0xff) / 255;\n    const blue = ((rgbAsInt >> 8) & 0xff) / 255;\n    const alpha = (rgbAsInt & 0x000000ff) / 255;\n    rgbColor = new RgbColor(red, green, blue, alpha);\n  }\n\n  if (hexColor.length === 6) {\n    const red = ((rgbAsInt >> 16) & 0xff) / 255;\n    const green = ((rgbAsInt >> 8) & 0xff) / 255;\n    const blue = (rgbAsInt & 0xff) / 255;\n    rgbColor = new RgbColor(red, green, blue);\n  }\n\n  return rgbColor;\n};\n\nexport {\n  createPrimaryPalette,\n  createComplementaryPalette,\n  createAnalogousPalette,\n  createTriadicPalette,\n  RgbColor,\n  toRgbColorOrNull,\n};\n"]}