You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have hex(::Colorant), but it would be nice to have functions to convert colors to the other formats accepted by parse, specifically CSS's rgb(...), rgba(...), and hsl(...).
The text was updated successfully, but these errors were encountered:
As long as the names of that new functions do not cause confusion, I think it's a good idea to add them.
Would you like to submit a PR?
FWIW, here's why just "I" didn't really tackle the conversion to CSS notations in Colors.jl:
Many tools support the interactive visualization of hex notation today (e.g. #C0FFEE) and there is little benefit in using function notation in auto-generated documents.
In auto-generated documents, there are needs for the shortest representation, but the :s/:S option of the hex() solved most of the demanded. There are only ~30 exceptions, such as red and indigo, and we can hardcode them easily.
Any conversion to function notation can be written in a few lines of script. On the other hand, function notation has some preferences (e.g. number of significant digits), and there is no easy way to specify them.
The only technical challenge is "3.". For example, using the printf format is nonsense, because you can use the @printf. 😄
Development of Colors v0.13 series has started. Although any new features can be added in v0.13.x, it is preferable that they are included in the v0.13.0 release.
@jlumpe (or anyone else who wants to add this feature), please propose a design for the API. As mentioned above, I don't have a good idea about the API.
We have
hex(::Colorant)
, but it would be nice to have functions to convert colors to the other formats accepted byparse
, specifically CSS'srgb(...)
,rgba(...)
, andhsl(...)
.The text was updated successfully, but these errors were encountered: