-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swapping the color notation in CSS #19
Comments
rmaksim
added a commit
that referenced
this issue
Oct 28, 2012
Try to test. from:
to:
again:
|
Aha, it works! Cool. Some thoughts:
|
Yeah, have been thought - but a little later. |
That's cool. Here are some of my thoughts:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Colors in CSS can be described in different ways: Hexadecimal, rgb, rgba, hsl and hsla.
Right now the
dec_max
anddec_all
actions are the same for the colors, so we could change one of them to the new action: rotate the notation for the color.That way, the color described as
#FFF
would becomergba(255,255,255,1)
and thenhsla(0,0%,100%,1)
(plain rgb and hsl are rarely used, so we could just forgot about them)If the color have the alpha less than
1
, we could rotate only betweenrgba
andhsla
, so we wouldn't lose the alpha occasionally.There could still be some issues, like not every color in RGB can be described in HSL, but we could either just forgot about that, either add a comment with the initial color after the transform, that could be used to restore the color to it's previous state if it was changed. Actually, doing so we could keep the alpha for the switching to hexadecimal color.
This way the chain would look like:
color: rgba(255,255,255,0.5);
color: hsla(0,0%,100%,0.5);
color: #FFF; /* alpha: 0.5 */
color: rgba(255,255,255,0.5);
again.This would allow us to easy change the color defined in any notation using the appropriate way we want.
The text was updated successfully, but these errors were encountered: