Skip to content

Commit

Permalink
feat: new color palette
Browse files Browse the repository at this point in the history
  • Loading branch information
ten3roberts committed Mar 21, 2024
1 parent 964aded commit f2856f3
Show file tree
Hide file tree
Showing 30 changed files with 1,387 additions and 581 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ wasm-bindgen = "0.2"
web-sys = { version = "0.3", features = ["Clipboard"] }
tracing-tree = "0.3"
heck = "0.5"
ordered-float = "4.2"

[dependencies]
violet-wgpu = { path = "violet-wgpu" }
Expand Down
18 changes: 12 additions & 6 deletions colors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
colors = require("colors.json")
colors = require("./colors.json")

console.log(`use palette::Srgba;
use crate::srgba;
Expand All @@ -9,16 +9,22 @@ function kebabToSnakeCase(kebabCaseString) {
}

for (var color_name in colors) {
let uppercase_name = kebabToSnakeCase(color_name);
const tints = colors[color_name];
for (var tint in tints) {
const color = tints[tint];
let color_name = kebabToSnakeCase(color_name);
// console.log(`tint: ${ tint }, name: ${ name }, value: ${ color } `)

// console.log(`tint: ${ tint }, uppercase_name: ${ uppercase_name }, value: ${ color } `)
console.log(
`pub const ${color_name}_${tint.toUpperCase()}: Srgba = srgba!("${color}"); `,
`pub const ${uppercase_name}_${tint.toUpperCase()}: Srgba = srgba!("${color}"); `,
);
}

const tint_names = Object.keys(tints).map((tint) => ` ${color_name}_${tint.toUpperCase()},\n`).join("");
console.log(`pub const ${color_name}_TINTS: [Srgba; ${Object.keys(tints).length}] = [\n${tint_names}];`)
}

for (var color_name in colors) {
let uppercase_name = kebabToSnakeCase(color_name);
const tints = colors[color_name];
const tint_names = Object.keys(tints).map((tint) => ` ${uppercase_name}_${tint.toUpperCase()},\n`).join("");
console.log(`pub const ${uppercase_name}_TINTS: [Srgba; ${Object.keys(tints).length}] = [\n${tint_names}];`)
}
184 changes: 184 additions & 0 deletions colors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
{
"stone": {
"50": "#e7e7e7",
"100": "#dadada",
"200": "#bfbfbf",
"300": "#a5a5a5",
"400": "#8b8b8b",
"500": "#737373",
"600": "#5b5b5b",
"700": "#454545",
"800": "#2f2f2f",
"900": "#1b1b1b",
"950": "#121212"
},
"platinum": {
"50": "#e8e7e6",
"100": "#dbd9d8",
"200": "#c1bebc",
"300": "#a8a4a1",
"400": "#908a86",
"500": "#77726d",
"600": "#5f5a56",
"700": "#474441",
"800": "#312f2d",
"900": "#1c1b1a",
"950": "#131211"
},
"zinc": {
"50": "#e6e7ea",
"100": "#d8dadd",
"200": "#bdbfc4",
"300": "#a2a5ac",
"400": "#888b95",
"500": "#6f737e",
"600": "#585b64",
"700": "#42454b",
"800": "#2e2f33",
"900": "#1a1b1e",
"950": "#111214"
},
"cherry": {
"50": "#f7e1e4",
"100": "#ecd2d6",
"200": "#d8b4ba",
"300": "#c8959e",
"400": "#b97582",
"500": "#a45969",
"600": "#844553",
"700": "#61363f",
"800": "#42262c",
"900": "#271519",
"950": "#1b0d10"
},
"copper": {
"50": "#f6e3d9",
"100": "#ead5c8",
"200": "#d6b8a6",
"300": "#c59b81",
"400": "#b57d59",
"500": "#a06137",
"600": "#814c29",
"700": "#5f3b23",
"800": "#40291a",
"900": "#26170e",
"950": "#1b0f07"
},
"redwood": {
"50": "#ffded9",
"100": "#f9cec9",
"200": "#e9aea7",
"300": "#de8b82",
"400": "#d5645a",
"500": "#c1413a",
"600": "#9c312b",
"700": "#722a25",
"800": "#4d1f1b",
"900": "#2e110f",
"950": "#210a08"
},
"amber": {
"50": "#f4e6c5",
"100": "#e9d8b1",
"200": "#d4bd84",
"300": "#c3a046",
"400": "#b48300",
"500": "#9f6700",
"600": "#805100",
"700": "#5e3e00",
"800": "#402c00",
"900": "#261900",
"950": "#1a1000"
},
"rose": {
"50": "#fcdeea",
"100": "#f2cedd",
"200": "#e0afc4",
"300": "#d28cac",
"400": "#c66895",
"500": "#b1477d",
"600": "#8f3664",
"700": "#692d4b",
"800": "#472133",
"900": "#2a121e",
"950": "#1e0a14"
},
"forest": {
"50": "#dbefc9",
"100": "#cbe3b5",
"200": "#abcc8a",
"300": "#87b651",
"400": "#62a100",
"500": "#428900",
"600": "#326d00",
"700": "#2a5100",
"800": "#1e3800",
"900": "#102100",
"950": "#091600"
},
"emerald": {
"50": "#baf7e3",
"100": "#a2ebd5",
"200": "#64d7b8",
"300": "#00c59b",
"400": "#00b47e",
"500": "#009d63",
"600": "#007f4e",
"700": "#005e3c",
"800": "#00402a",
"900": "#002618",
"950": "#001a0f"
},
"teal": {
"50": "#b3f6f4",
"100": "#9aebe9",
"200": "#50d6d4",
"300": "#00c4c3",
"400": "#00b1b4",
"500": "#009aa0",
"600": "#007c81",
"700": "#005c5f",
"800": "#003f40",
"900": "#002526",
"950": "#001a1a"
},
"ocean": {
"50": "#cfe8ff",
"100": "#bddbff",
"200": "#96bfff",
"300": "#68a2ff",
"400": "#327fff",
"500": "#005bff",
"600": "#0046dc",
"700": "#063a9d",
"800": "#0b2a68",
"900": "#05183f",
"950": "#020f2f"
},
"violet": {
"50": "#ecdfff",
"100": "#dfd0ff",
"200": "#c7b0fb",
"300": "#b28df9",
"400": "#9f63fb",
"500": "#8a38ee",
"600": "#6f29c2",
"700": "#51278b",
"800": "#371e5d",
"900": "#201138",
"950": "#160929"
},
"amethyst": {
"50": "#f4ddff",
"100": "#e9cefb",
"200": "#d4aded",
"300": "#c389e5",
"400": "#b45ee1",
"500": "#9f35d1",
"600": "#8026aa",
"700": "#5e257b",
"800": "#401d52",
"900": "#261031",
"950": "#1a0924"
}
}
128 changes: 128 additions & 0 deletions colors.save.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
[
{
"color": {
"l": 0.49969554,
"chroma": 0.0,
"hue": 0.0
},
"falloff": 15.0,
"name": "Stone"
},
{
"color": {
"l": 0.5,
"chroma": 0.01,
"hue": 62.0
},
"falloff": 15.0,
"name": "Platinum"
},
{
"color": {
"l": 0.49287146,
"chroma": 0.017929163,
"hue": 270.86707
},
"falloff": 15.0,
"name": "Zinc"
},
{
"color": {
"l": 0.49898326,
"chroma": 0.1,
"hue": 7.0
},
"falloff": 15.0,
"name": "Cherry"
},
{
"color": {
"l": 0.50082797,
"chroma": 0.1,
"hue": 52.90864
},
"falloff": 15.0,
"name": "Copper"
},
{
"color": {
"l": 0.5,
"chroma": 0.165,
"hue": 27.0
},
"falloff": 15.0,
"name": "Redwood"
},
{
"color": {
"l": 0.50735986,
"chroma": 0.185,
"hue": 88.0
},
"falloff": 15.0,
"name": "Amber"
},
{
"color": {
"l": 0.51262295,
"chroma": 0.15,
"hue": 351.19986
},
"falloff": 15.0,
"name": "Rose"
},
{
"color": {
"l": 0.5,
"chroma": 0.225,
"hue": 130.0
},
"falloff": 15.0,
"name": "Forest"
},
{
"color": {
"l": 0.5,
"chroma": 0.27,
"hue": 173.0
},
"falloff": 15.0,
"name": "Emerald"
},
{
"color": {
"l": 0.57011175,
"chroma": 0.27,
"hue": 193.86102
},
"falloff": 15.0,
"name": "Teal"
},
{
"color": {
"l": 0.5,
"chroma": 0.27,
"hue": 262.0
},
"falloff": 15.0,
"name": "Ocean"
},
{
"color": {
"l": 0.50050735,
"chroma": 0.25,
"hue": 297.98505
},
"falloff": 15.0,
"name": "Violet"
},
{
"color": {
"l": 0.51195455,
"chroma": 0.23,
"hue": 312.22745
},
"falloff": 15.0,
"name": "Amethyst"
}
]
Loading

0 comments on commit f2856f3

Please sign in to comment.