How can I spin the color hue for each item in a loop?
If I have:
items = {
item1: 'item1',
item2: 'item2',
item3: 'item3'
}
For each item in this list, I want to change it's hue by 30%.
Something like this:
for name, item in items
.{name}
color: hue(green, 30%)
If you aim at using CSS only, no-javascript solution, I would recommend using LessHat or similar framework (details about hue rotation for LessHat could be found here: https://github.com/madebysource/lesshat/blob/master/mixins/hue-rotate/hue-rotate.md). You can statically generate list of rotated items, however it will only work for given (and constant) list of items.
Using Stylus you could try:
If you want to dynamically change hue of given elements, you have to use Javascript - I would recommend using JQuery Color library (found here: https://github.com/jquery/jquery-color/).
IMPORTANT NOTE: Example below is using angle changes (hue is descibed as angle between 0 and 360, if it would be described by percentage, red would not be affected, because its value is 0 deg).
Example could be found here: http://jsfiddle.net/5r5w4x7g/4/