Created
March 26, 2015 21:42
-
-
Save ivan-demchenko/e603afe1843f88591c47 to your computer and use it in GitHub Desktop.
Organise colours palette with Stylus
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
// 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