Skip to content

Instantly share code, notes, and snippets.

@ivan-demchenko
Created March 26, 2015 21:42
Show Gist options
  • Save ivan-demchenko/e603afe1843f88591c47 to your computer and use it in GitHub Desktop.
Save ivan-demchenko/e603afe1843f88591c47 to your computer and use it in GitHub Desktop.
Organise colours palette with Stylus
// These are colors in our palette
availableColors = red #F00,
blue #00F,
green #0F0
// Function that can find a color by name
colourByName(name)
return pair[1] if name == pair[0] for pair in availableColors
// Now we can find our color by name
body
color colorByName(blue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment