Skip to content
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

rgb/rgba and hsl/hsla advanced syntax options #37

Closed
7 tasks done
meyfa opened this issue Dec 30, 2017 · 1 comment
Closed
7 tasks done

rgb/rgba and hsl/hsla advanced syntax options #37

meyfa opened this issue Dec 30, 2017 · 1 comment
Labels
enhancement Improvement to an existing feature

Comments

@meyfa
Copy link
Owner

meyfa commented Dec 30, 2017

According to MDN [1], there are quite a few more ways to specify colors than are currently covered by the SVG::parseColor method.

The following notations in particular would need to be handled:

  • #RRGGBBAA (hexadecimal notation with alpha component)
  • #RGBA (short hex notation with alpha component)
  • rgb(255, 255, 255, 50%) (note the percentage used for alpha)
  • rgb(255 255 255) (note the missing commas)
  • rgb(255 255 255 / 50%) and rgb(255 255 255 / .5) (note the slash)
  • hsl with different units
  • hsl with alpha given as percentage

Keep in mind that as per #36, everything mentioned above for rgb also applies to rgba, and everything mentioned for hsl also applies to hsla.

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

@meyfa meyfa added the enhancement Improvement to an existing feature label Dec 30, 2017
@meyfa
Copy link
Owner Author

meyfa commented Jan 5, 2018

Fixed in 203c93e.

@meyfa meyfa closed this as completed Jan 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant