Allow use of 'and' when mixing colors
parent
67460e170d
commit
5707700a7c
|
@ -36,7 +36,7 @@ sub normalize_color {
|
||||||
|
|
||||||
my %query_forms = (
|
my %query_forms = (
|
||||||
"rand(om)? $scolor" => \&random_color,
|
"rand(om)? $scolor" => \&random_color,
|
||||||
"mix (?<c1>$color_re) (?<c2>$color_re)" => \&mix_colors,
|
"mix (?<c1>$color_re)( and)? (?<c2>$color_re)" => \&mix_colors,
|
||||||
);
|
);
|
||||||
my @query_forms = keys %query_forms;
|
my @query_forms = keys %query_forms;
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,8 @@ ddg_goodie_test(
|
||||||
'mix 000000 ffffff' => $tc_mix_white_black,
|
'mix 000000 ffffff' => $tc_mix_white_black,
|
||||||
# # With leading '#'
|
# # With leading '#'
|
||||||
'mix #000000 #ffffff' => $tc_mix_white_black,
|
'mix #000000 #ffffff' => $tc_mix_white_black,
|
||||||
|
# # 'and'
|
||||||
|
'mix 000000 and ffffff' => $tc_mix_white_black,
|
||||||
# Invalid queries
|
# Invalid queries
|
||||||
'color' => undef,
|
'color' => undef,
|
||||||
'color ffffff' => undef,
|
'color ffffff' => undef,
|
||||||
|
|
Loading…
Reference in New Issue