Last active
November 9, 2022 21:05
-
-
Save JeffJacobson/cb140baf71fea8297781dc86908214ad to your computer and use it in GitHub Desktop.
Commodore 64 color palette JSON and script that generated it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Black": "#000000", | |
"White": "#FFFFFF", | |
"Red": "#880000", | |
"Cyan": "#AAFFEE", | |
"Violet / purple": "#CC44CC", | |
"Green": "#00CC55", | |
"Blue": "#0000AA", | |
"Yellow": "#EEEE77", | |
"Orange": "#DD8855", | |
"Brown": "#664400", | |
"Light red": "#FF7777", | |
"Dark grey / grey 1": "#333333", | |
"Grey 2": "#777777", | |
"Light green": "#AAFF66", | |
"Light blue": "#0088FF", | |
"Light grey / grey 3": "#BBBBBB" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ran this script on https://c64online.com/commodore-64-color-codes/ on 2022-11-09 to generate JSON file. | |
((table) => { | |
const firstCells = table.querySelectorAll("tr:not(:first-child) > td:first-child"); | |
const rows = [...firstCells].map(c => c.parentElement.querySelectorAll("td:nth-child(2),td:last-child")).map(kv => [kv[0].textContent, kv[1].textContent]); | |
const output = {}; | |
for (const [key, value] of rows) { | |
output[key] = value; | |
} | |
const colors = new Map([...rows]); | |
console.log(output) | |
console.log(JSON.stringify(output, undefined, 2)) | |
})(document.body.querySelector("figure.wp-block-table:nth-child(12) > table:nth-child(1)")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment