ColorCodes: allow for rgb #123456-style queries

master
Matt Miller 2014-09-09 18:23:13 -04:00
parent c84f0464d2
commit ce92e69d7d
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ handle matches => sub {
$color =~ s/(,\s*|\s+)/,/g; # Spaces to commas for things like "hsl 194 0.53 0.79"
if ($color =~ /^[0-9a-f]{3,6}$/) { # Color looks like a hex code
if ($color =~ s/#?([0-9a-f]{3,6})$/$1/) { # Color looks like a hex code, strip the leading #
$color = join('', map { $_ . $_ } (split '', $color)) if (length($color) == 3); # Make three char hex into six chars by repeating each in turn
$type = 'rgb8';
} else {