Page MenuHomeSealhub

colors.ts
No OneTemporary

colors.ts

import { colord } from "colord";
export const colors: Record<string, Record<string, string>> = {
basic: {
navy: "#001f3f",
blue: "#0074D9",
aqua: "#7FDBFF",
teal: "#39CCCC",
purple: "#B10DC9",
fuchsia: "#F012BE",
maroon: "#85144b",
red: "#ff4136",
orange: "#ff851b",
yellow: "#ffdc00",
olive: "#3d9970",
green: "#2ecc40",
lime: "#01ff70",
black: "#111111",
gray: "#aaaaaa",
silver: "#dddddd",
white: "#ffffff",
},
};
colors.brand = {};
colors.brand["text-bg"] = colors.basic!.white!;
colors.brand["text-fg"] = colors.basic!.black!;
colors.brand["accent"] = colors.basic!.blue!;
colors.brand["text-accent"] = colors.brand.accent!;
const shade_step = 0.1;
const hue_step = -3;
const saturation_step = 0.05;
for (const [group_name, group] of Object.entries(colors)) {
for (const [color_name, color] of Object.entries(group)) {
for (const shade_variant of ["light", "dark"]) {
for (let i = 1; i <= 8; i++) {
let shifted = colord(color)
.darken((shade_variant == "dark" ? 1 : -1) * i * shade_step)
.rotate((shade_variant == "dark" ? 1 : -1) * i * hue_step);
if (shifted.toHsl().s !== 0) {
shifted = shifted.saturate(
(shade_variant == "dark" ? 1 : -1) * i * saturation_step
);
}
const hex = shifted.toHex();
colors[group_name]![`${color_name}-${shade_variant}${i}`] = hex;
}
}
}
}

File Metadata

Mime Type
text/x-java
Expires
Sat, Nov 8, 05:43 (1 d, 6 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1034063
Default Alt Text
colors.ts (1 KB)

Event Timeline