1 line
1.5 KiB
Plaintext
1 line
1.5 KiB
Plaintext
{"version":3,"file":"is_dark-151801f4.js","sources":["../../../node_modules/.pnpm/khroma@2.0.0/node_modules/khroma/dist/methods/luminance.js","../../../node_modules/.pnpm/khroma@2.0.0/node_modules/khroma/dist/methods/is_light.js","../../../node_modules/.pnpm/khroma@2.0.0/node_modules/khroma/dist/methods/is_dark.js"],"sourcesContent":["/* IMPORT */\nimport _ from '../utils/index.js';\nimport Color from '../color/index.js';\n/* MAIN */\n//SOURCE: https://planetcalc.com/7779\nconst luminance = (color) => {\n const { r, g, b } = Color.parse(color);\n const luminance = .2126 * _.channel.toLinear(r) + .7152 * _.channel.toLinear(g) + .0722 * _.channel.toLinear(b);\n return _.lang.round(luminance);\n};\n/* EXPORT */\nexport default luminance;\n","/* IMPORT */\nimport luminance from './luminance.js';\n/* MAIN */\nconst isLight = (color) => {\n return luminance(color) >= .5;\n};\n/* EXPORT */\nexport default isLight;\n","/* IMPORT */\nimport isLight from './is_light.js';\n/* MAIN */\nconst isDark = (color) => {\n return !isLight(color);\n};\n/* EXPORT */\nexport default isDark;\n"],"names":["luminance","color","r","g","b","Color","_","luminance$1","isLight","isLight$1","isDark","isDark$1"],"mappings":";AAKA,MAAMA,IAAY,CAACC,MAAU;AACzB,QAAM,EAAE,GAAAC,GAAG,GAAAC,GAAG,GAAAC,EAAG,IAAGC,EAAM,MAAMJ,CAAK,GAC/BD,IAAY,SAAQM,EAAE,QAAQ,SAASJ,CAAC,IAAI,SAAQI,EAAE,QAAQ,SAASH,CAAC,IAAI,SAAQG,EAAE,QAAQ,SAASF,CAAC;AAC9G,SAAOE,EAAE,KAAK,MAAMN,CAAS;AACjC,GAEAO,IAAeP,GCRTQ,IAAU,CAACP,MACND,EAAUC,CAAK,KAAK,KAG/BQ,IAAeD,GCJTE,IAAS,CAACT,MACL,CAACO,EAAQP,CAAK,GAGzBU,IAAeD;"} |