Skip to content

Instantly share code, notes, and snippets.

@greggirwin
Created January 11, 2018 18:15
Show Gist options
  • Save greggirwin/cb2c32d247549e5647fa49dd5eb91d98 to your computer and use it in GitHub Desktop.
Save greggirwin/cb2c32d247549e5647fa49dd5eb91d98 to your computer and use it in GitHub Desktop.
Mod of @toomasv's color picker
; The original is at https://gist.github.com/toomasv/19e45ce2cbd7dc213548400fcdec1f8b
context [
colors: exclude sort extract load help-string tuple! 2 [glass]
lay: copy [
style color: base 70x70 font [size: 8] wrap top on-down [
write-clipboard form face/extra
tx/data: rejoin [
"Color '" face/extra "' (" get face/extra ") copied to clipboard!"
]
]
]
x: 0
foreach j colors [
font-color: either 3 = length? get j [255.255.255 - (get j) / 2]['black]
append lay compose/deep [
color (j) (rejoin [form j #"^/" form get j])
font [color: (font-color)]
extra (to lit-word! j)
]
if (x: x + 1) % 10 = 0 [append lay 'return]
]
view append lay [tx: text 310x70 white "color" font [size: 12] wrap center]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment