Skip to content

Instantly share code, notes, and snippets.

@toomasv
Last active January 12, 2018 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toomasv/19e45ce2cbd7dc213548400fcdec1f8b to your computer and use it in GitHub Desktop.
Save toomasv/19e45ce2cbd7dc213548400fcdec1f8b to your computer and use it in GitHub Desktop.
Red [
Needs: View
Acknowledgement: {Color extraction by @9214}
Author: "Toomas Vooglaid"
Date: 2018-01-11
Purpose: {To easy picking Red predefined colors}
]
context [
colors: exclude sort extract load help-string tuple! 2 [glass]
lay: copy [style color: base 70x70 font [size: 8] wrap top]
x: 0
foreach j colors [
fcol: either 3 = length? get j [255.255.255 - (get j) / 2]['black]
append lay compose/deep [
color (j)
font [color: (fcol)]
(rejoin [form j #"^/" form get j])
on-down [
write-clipboard (form j)
tx/data: rejoin ["Color '" (to-lit-word j) "' (" (get j) ") copied to clipboard!"]
]
]
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