Skip to content

Instantly share code, notes, and snippets.

@haschdl
Created February 17, 2020 07:51
Show Gist options
  • Save haschdl/044f8fdab73a76c3777fe51af4bd1fc1 to your computer and use it in GitHub Desktop.
Save haschdl/044f8fdab73a76c3777fe51af4bd1fc1 to your computer and use it in GitHub Desktop.
Adobe Colors to Java array
/* This script is a quick hack to extract the HEX colors
from color.adobe.com and save it to the clipboard as a java array
I created this to import the colors in Processing.
*/
let selector = '[class^=ColorModes__colorValue_';
let elements = Array.from(document.querySelectorAll(selector));
elements = elements.filter(el => el.innerText.startsWith("#")).map(el => el.innerText);
elements = elements.map(i => "0xFF" + i.replace("#",""));
[...new Set(elements)].toString();
//returns "0xFF82ABBF,0xFFFE7427,0xFFFFDC46,0xFF94401B,0xFF3B3930"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment