swhitty / SwiftDraw

Swift library and command line tool to convert SVGs into SFSymbol, PNG, PDF and Swift source code.
zlib License
389 stars 49 forks source link

padHex #a5F should be parsed as #aa55FF #24

Closed mk-wang closed 10 months ago

mk-wang commented 1 year ago

According to https://www.w3.org/TR/css-color-3/#colorunits

The format of an RGB value in hexadecimal notation is a ‘#’ immediately followed by either three or six hexadecimal characters. The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00. This ensures that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the color depth of the display.

swhitty commented 11 months ago

🙏🏼 thank you for reporting and fixing this @mk-wang. This has been merged to develop and will be included in the next release.

swhitty commented 11 months ago

Included within 0.15.0 release