diff --git a/flake.nix b/flake.nix index 72e87fd..bcb993d 100644 --- a/flake.nix +++ b/flake.nix @@ -28,8 +28,10 @@ { # Shell default = pkgs.mkShell { - packages = [ ] - ++ project-config.packages; + packages = [ + pkgs.deno + ] + ++ project-config.packages; shellHook = project-config.shellHook; }; diff --git a/src/cli.ts b/src/cli.ts new file mode 100644 index 0000000..ddfe1e2 --- /dev/null +++ b/src/cli.ts @@ -0,0 +1,38 @@ +// We need an empty export for top-level await. +export {}; + +// Start with the basic CSS header. +let lines: string[] = [":root {"]; + +// We have ten colors, with 0 being the base hue and the others being evenly +// rotated around the color wheel. +for (let color = 0; color < 10; color++) { + // Figure out the rotation. + const rotation = color * 36; // 1/10th of a circle + + // For each hue, we have ten levels of brightness ranging from very dark + // to very light. + for (let brightness = 0; brightness < 10; brightness++) { + // We use a standard code (--color-cXbY) for our codes. + const code = `--color-c${color}b${brightness}`; + + // Figure out the ramps we are using for brighteness. + const l = brightness * 11; + const s = 50 - brightness * 5; + + // Write out the CSS. + lines.push( + ` ${code}: lch(${l.toFixed(1)} ${s.toFixed( + 1, + )} calc(var(--color-hue) + ${rotation}));`, + ); + } +} + +// Finish up the lines. +lines.push("}"); + +// Write out the files. +const text = new TextEncoder().encode(lines.join("\n")); + +await Deno.writeFile("src/colors.css", text, { mode: 0o644 }); diff --git a/src/colors.css b/src/colors.css new file mode 100644 index 0000000..f053e54 --- /dev/null +++ b/src/colors.css @@ -0,0 +1,102 @@ +:root { + --color-c0b0: lch(0 50 calc(var(--color-hue) + 0)); + --color-c0b1: lch(11 45 calc(var(--color-hue) + 0)); + --color-c0b2: lch(22 40 calc(var(--color-hue) + 0)); + --color-c0b3: lch(33 35 calc(var(--color-hue) + 0)); + --color-c0b4: lch(44 30 calc(var(--color-hue) + 0)); + --color-c0b5: lch(55 25 calc(var(--color-hue) + 0)); + --color-c0b6: lch(66 20 calc(var(--color-hue) + 0)); + --color-c0b7: lch(77 15 calc(var(--color-hue) + 0)); + --color-c0b8: lch(88 10 calc(var(--color-hue) + 0)); + --color-c0b9: lch(99 5 calc(var(--color-hue) + 0)); + --color-c1b0: lch(0 50 calc(var(--color-hue) + 36)); + --color-c1b1: lch(11 45 calc(var(--color-hue) + 36)); + --color-c1b2: lch(22 40 calc(var(--color-hue) + 36)); + --color-c1b3: lch(33 35 calc(var(--color-hue) + 36)); + --color-c1b4: lch(44 30 calc(var(--color-hue) + 36)); + --color-c1b5: lch(55 25 calc(var(--color-hue) + 36)); + --color-c1b6: lch(66 20 calc(var(--color-hue) + 36)); + --color-c1b7: lch(77 15 calc(var(--color-hue) + 36)); + --color-c1b8: lch(88 10 calc(var(--color-hue) + 36)); + --color-c1b9: lch(99 5 calc(var(--color-hue) + 36)); + --color-c2b0: lch(0 50 calc(var(--color-hue) + 72)); + --color-c2b1: lch(11 45 calc(var(--color-hue) + 72)); + --color-c2b2: lch(22 40 calc(var(--color-hue) + 72)); + --color-c2b3: lch(33 35 calc(var(--color-hue) + 72)); + --color-c2b4: lch(44 30 calc(var(--color-hue) + 72)); + --color-c2b5: lch(55 25 calc(var(--color-hue) + 72)); + --color-c2b6: lch(66 20 calc(var(--color-hue) + 72)); + --color-c2b7: lch(77 15 calc(var(--color-hue) + 72)); + --color-c2b8: lch(88 10 calc(var(--color-hue) + 72)); + --color-c2b9: lch(99 5 calc(var(--color-hue) + 72)); + --color-c3b0: lch(0 50 calc(var(--color-hue) + 108)); + --color-c3b1: lch(11 45 calc(var(--color-hue) + 108)); + --color-c3b2: lch(22 40 calc(var(--color-hue) + 108)); + --color-c3b3: lch(33 35 calc(var(--color-hue) + 108)); + --color-c3b4: lch(44 30 calc(var(--color-hue) + 108)); + --color-c3b5: lch(55 25 calc(var(--color-hue) + 108)); + --color-c3b6: lch(66 20 calc(var(--color-hue) + 108)); + --color-c3b7: lch(77 15 calc(var(--color-hue) + 108)); + --color-c3b8: lch(88 10 calc(var(--color-hue) + 108)); + --color-c3b9: lch(99 5 calc(var(--color-hue) + 108)); + --color-c4b0: lch(0 50 calc(var(--color-hue) + 144)); + --color-c4b1: lch(11 45 calc(var(--color-hue) + 144)); + --color-c4b2: lch(22 40 calc(var(--color-hue) + 144)); + --color-c4b3: lch(33 35 calc(var(--color-hue) + 144)); + --color-c4b4: lch(44 30 calc(var(--color-hue) + 144)); + --color-c4b5: lch(55 25 calc(var(--color-hue) + 144)); + --color-c4b6: lch(66 20 calc(var(--color-hue) + 144)); + --color-c4b7: lch(77 15 calc(var(--color-hue) + 144)); + --color-c4b8: lch(88 10 calc(var(--color-hue) + 144)); + --color-c4b9: lch(99 5 calc(var(--color-hue) + 144)); + --color-c5b0: lch(0 50 calc(var(--color-hue) + 180)); + --color-c5b1: lch(11 45 calc(var(--color-hue) + 180)); + --color-c5b2: lch(22 40 calc(var(--color-hue) + 180)); + --color-c5b3: lch(33 35 calc(var(--color-hue) + 180)); + --color-c5b4: lch(44 30 calc(var(--color-hue) + 180)); + --color-c5b5: lch(55 25 calc(var(--color-hue) + 180)); + --color-c5b6: lch(66 20 calc(var(--color-hue) + 180)); + --color-c5b7: lch(77 15 calc(var(--color-hue) + 180)); + --color-c5b8: lch(88 10 calc(var(--color-hue) + 180)); + --color-c5b9: lch(99 5 calc(var(--color-hue) + 180)); + --color-c6b0: lch(0 50 calc(var(--color-hue) + 216)); + --color-c6b1: lch(11 45 calc(var(--color-hue) + 216)); + --color-c6b2: lch(22 40 calc(var(--color-hue) + 216)); + --color-c6b3: lch(33 35 calc(var(--color-hue) + 216)); + --color-c6b4: lch(44 30 calc(var(--color-hue) + 216)); + --color-c6b5: lch(55 25 calc(var(--color-hue) + 216)); + --color-c6b6: lch(66 20 calc(var(--color-hue) + 216)); + --color-c6b7: lch(77 15 calc(var(--color-hue) + 216)); + --color-c6b8: lch(88 10 calc(var(--color-hue) + 216)); + --color-c6b9: lch(99 5 calc(var(--color-hue) + 216)); + --color-c7b0: lch(0 50 calc(var(--color-hue) + 252)); + --color-c7b1: lch(11 45 calc(var(--color-hue) + 252)); + --color-c7b2: lch(22 40 calc(var(--color-hue) + 252)); + --color-c7b3: lch(33 35 calc(var(--color-hue) + 252)); + --color-c7b4: lch(44 30 calc(var(--color-hue) + 252)); + --color-c7b5: lch(55 25 calc(var(--color-hue) + 252)); + --color-c7b6: lch(66 20 calc(var(--color-hue) + 252)); + --color-c7b7: lch(77 15 calc(var(--color-hue) + 252)); + --color-c7b8: lch(88 10 calc(var(--color-hue) + 252)); + --color-c7b9: lch(99 5 calc(var(--color-hue) + 252)); + --color-c8b0: lch(0 50 calc(var(--color-hue) + 288)); + --color-c8b1: lch(11 45 calc(var(--color-hue) + 288)); + --color-c8b2: lch(22 40 calc(var(--color-hue) + 288)); + --color-c8b3: lch(33 35 calc(var(--color-hue) + 288)); + --color-c8b4: lch(44 30 calc(var(--color-hue) + 288)); + --color-c8b5: lch(55 25 calc(var(--color-hue) + 288)); + --color-c8b6: lch(66 20 calc(var(--color-hue) + 288)); + --color-c8b7: lch(77 15 calc(var(--color-hue) + 288)); + --color-c8b8: lch(88 10 calc(var(--color-hue) + 288)); + --color-c8b9: lch(99 5 calc(var(--color-hue) + 288)); + --color-c9b0: lch(0 50 calc(var(--color-hue) + 324)); + --color-c9b1: lch(11 45 calc(var(--color-hue) + 324)); + --color-c9b2: lch(22 40 calc(var(--color-hue) + 324)); + --color-c9b3: lch(33 35 calc(var(--color-hue) + 324)); + --color-c9b4: lch(44 30 calc(var(--color-hue) + 324)); + --color-c9b5: lch(55 25 calc(var(--color-hue) + 324)); + --color-c9b6: lch(66 20 calc(var(--color-hue) + 324)); + --color-c9b7: lch(77 15 calc(var(--color-hue) + 324)); + --color-c9b8: lch(88 10 calc(var(--color-hue) + 324)); + --color-c9b9: lch(99 5 calc(var(--color-hue) + 324)); +} diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..180e73f --- /dev/null +++ b/src/index.html @@ -0,0 +1,1152 @@ + + + + Ideas + + + + + +

Choose Your Favorite Color

+ +
+
+
+ +
+ +
+ Hue: + +
 
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ +

Color Grid

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
c0c1c2c3c4c5c6c7c8c9
b0c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
b1c0b1c1b1c2b1c3b1c4b1c5b1c6b1c7b1c8b1c9b1
b2c0b2c1b2c2b2c3b2c4b2c5b2c6b2c7b2c8b2c9b2
b3c0b3c1b3c2b3c3b3c4b3c5b3c6b3c7b3c8b3c9b3
b4c0b4c1b4c2b4c3b4c4b4c5b4c6b4c7b4c8b4c9b4
b5c0b5c1b5c2b5c3b5c4b5c5b5c6b5c7b5c8b5c9b5
b6c0b6c1b6c2b6c3b6c4b6c5b6c6b6c7b6c8b6c9b6
b7c0b7c1b7c2b7c3b7c4b7c5b7c6b7c7b7c8b7c9b7
b8c0b8c1b8c2b8c3b8c4b8c5b8c6b8c7b8c8b8c9b8
b9c0b9c1b9c2b9c3b9c4b9c5b9c6b9c7b9c8b9c9b9
+ +

Contrast Grid

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
c0c1c2c3c4c5c6c7c8c9
+5c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
+7c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
+9c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
-3c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
-7c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
-9c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
+5c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
+7c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
+9c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
-3c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
-7c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
-9c0b0c1b0c2b0c3b0c4b0c5b0c6b0c7b0c8b0c9b0
+ + + diff --git a/src/style.css b/src/style.css new file mode 100644 index 0000000..dee2322 --- /dev/null +++ b/src/style.css @@ -0,0 +1,2 @@ +@import url("./colors.css"); +@import url("./theme.css"); diff --git a/src/theme.css b/src/theme.css new file mode 100644 index 0000000..03e8433 --- /dev/null +++ b/src/theme.css @@ -0,0 +1,48 @@ +:root { + background-color: var(--color-c0b9); + color: var(--color-c0b1); +} + +@media (prefers-color-scheme: light) { + :root { + background-color: var(--color-c0b9); + color: var(--color-c0b1); + } +} + +@media (prefers-color-scheme: dark) { + :root { + background-color: var(--color-c0b0); + color: var(--color-c0b8); + } +} + +[data-prefers-color-scheme="light"] { + background-color: var(--color-c0b9); + color: var(--color-c0b1); +} + +[data-prefers-color-scheme="light"][data-prefers-contrast="more"] { + background-color: var(--color-c0b9); + color: var(--color-c0b0); +} + +[data-prefers-color-scheme="light"][data-prefers-contrast="less"] { + background-color: var(--color-c0b9); + color: var(--color-c0b2); +} + +[data-prefers-color-scheme="dark"] { + background-color: var(--color-c0b0); + color: var(--color-c0b8); +} + +[data-prefers-color-scheme="dark"][data-prefers-contrast="more"] { + background-color: var(--color-c0b0); + color: var(--color-c0b9); +} + +[data-prefers-color-scheme="dark"][data-prefers-contrast="less"] { + background-color: var(--color-c0b0); + color: var(--color-c0b7); +}