« get me outta code hell

util -> common-util - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util/colors.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-01-26 17:28:01 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-01-26 17:28:01 -0400
commit725a33ef50e836553c89a6576f5d281978fe7c47 (patch)
treeaea7906ffa1a24bbbd7b1bd405e20e2a05d9b95b /src/util/colors.js
parentd987efdf3f5e60ad81a5d243629208818cdf8211 (diff)
util -> common-util
Diffstat (limited to 'src/util/colors.js')
-rw-r--r--src/util/colors.js44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/util/colors.js b/src/util/colors.js
deleted file mode 100644
index 7298c46a..00000000
--- a/src/util/colors.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// Color and theming utility functions! Handy.
-
-export function getColors(themeColor, {
-  // chroma.js external dependency (https://gka.github.io/chroma.js/)
-  chroma,
-} = {}) {
-  if (!chroma) {
-    throw new Error('chroma.js library must be passed or bound for color manipulation');
-  }
-
-  const primary = chroma(themeColor);
-
-  const dark = primary.luminance(0.02);
-  const dim = primary.desaturate(2).darken(1.5);
-  const deep = primary.saturate(1.2).luminance(0.035);
-  const deepGhost = deep.alpha(0.8);
-  const light = chroma.average(['#ffffff', primary], 'rgb', [4, 1]);
-  const lightGhost = primary.luminance(0.8).saturate(4).alpha(0.08);
-
-  const bg = primary.luminance(0.008).desaturate(3.5).alpha(0.8);
-  const bgBlack = primary.saturate(1).luminance(0.0025).alpha(0.8);
-  const shadow = primary.desaturate(4).set('hsl.l', 0.05).alpha(0.8);
-
-  const hsl = primary.hsl();
-  if (isNaN(hsl[0])) hsl[0] = 0;
-
-  return {
-    primary: primary.hex(),
-
-    dark: dark.hex(),
-    dim: dim.hex(),
-    deep: deep.hex(),
-    deepGhost: deepGhost.hex(),
-    light: light.hex(),
-    lightGhost: lightGhost.hex(),
-
-    bg: bg.hex(),
-    bgBlack: bgBlack.hex(),
-    shadow: shadow.hex(),
-
-    rgb: primary.rgb(),
-    hsl,
-  };
-}