ClassyKit / Classy

Expressive, flexible, and powerful stylesheets for UIView and friends.
http://classykit.github.io/Classy/
MIT License
740 stars 76 forks source link

Defining a color with variable and alpha #86

Closed binyamg closed 7 years ago

binyamg commented 9 years ago
keithnorm commented 9 years ago

Seems like a great idea but it is not currently supported. Want to take a crack at implementing it? I think it would be cool to have darken and lighten functions to act on a base color as well.

Imagine a use-case like:

UIButton {
  background-color[state: normal]: $blue
  background-color[state: highlighted]: lighten($blue, 20%)
}

I may get around to adding that functionality.

dnedrow commented 7 years ago

@keithnorm , what does the 20% value represent? An alpha percentage increase/decrease? If so, would it take into account the current alpha of the color. Eg., blue with an alpha of 0.8, after lighten($blue, 20%) would end up with an alpha of 0.64? Or would the actual color be manipulated somehow? Eg., convert to HSL, manipulate L then convert back to RGB.

dnedrow commented 7 years ago

Added to wiki wish list.