Skip to content

Rewrite colors into shortest possible name

Jonathan Neuhauser requested to merge github/fork/nthykier/shorter-colors into master

Created by: nthykier

Improve the code for rewriting colors into recognising that some colors are shorter by name. This commit enables scour to rewrite rgb(255, 0, 0) into red which is slightly shorter than #f00 (ditto for tan and pink).

When the color name ties in length with the hexcode, then scour will leave it as-is if the input file used a variant of same length (e.g. blue, cyan and aqua will be left as-is). But if scour is rewriting the color code, it will prefer the hex code variant.

Signed-off-by: Niels Thykier niels@thykier.net

Merge request reports

Loading