thomasp85 / farver

High Performance Colourspace Manipulation in R
https://farver.data-imaginist.com
Other
128 stars 14 forks source link

farver::decode_colour() could accept 3 character hex codes #41

Closed francisbarton closed 4 months ago

francisbarton commented 1 year ago

3 character codes like #9aa are a useful shorthand, and are valid in HTML/CSS. Can farver be edited so as to accept these (and presumably convert them to the full 6 character code?)

farver::decode_colour("#9aa")
✘ Error: Malformed colour string `#9aa`. Must contain either 6 or 8 hex values
teunbrand commented 11 months ago

In R-devel, the short form is now accepted. See https://developer.r-project.org/blosxom.cgi/R-devel/NEWS/2023/09/01#n2023-09-01