Created
February 17, 2020 07:51
-
-
Save haschdl/044f8fdab73a76c3777fe51af4bd1fc1 to your computer and use it in GitHub Desktop.
Adobe Colors to Java array
This file contains 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
/* 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