Commit bf099c10 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Bugfix in color conversion

parent 675f6414
...@@ -107,6 +107,7 @@ let compress = function ...@@ -107,6 +107,7 @@ let compress = function
| Hexcolor "dda0dd" -> Ident "plum" | Hexcolor "dda0dd" -> Ident "plum"
| Ident "powderblue" -> Hexcolor "b0e0e6" | Ident "powderblue" -> Hexcolor "b0e0e6"
| Hexcolor "800080" -> Ident "purple" | Hexcolor "800080" -> Ident "purple"
| Hexcolor "f00" -> Ident "red"
| Ident "rosybrown" -> Hexcolor "bc8f8f" | Ident "rosybrown" -> Hexcolor "bc8f8f"
| Ident "royalblue" -> Hexcolor "4169e1" | Ident "royalblue" -> Hexcolor "4169e1"
| Ident "saddlebrown" -> Hexcolor "8b4513" | Ident "saddlebrown" -> Hexcolor "8b4513"
......
...@@ -16,7 +16,7 @@ let rec shorten_expr = function ...@@ -16,7 +16,7 @@ let rec shorten_expr = function
(* #aabbcc -> #abc *) (* #aabbcc -> #abc *)
| Hexcolor h when Str.string_match hex6 h 0 -> | Hexcolor h when Str.string_match hex6 h 0 ->
let gr n = Str.matched_group n h in let gr n = Str.matched_group n h in
Hexcolor (gr 1 ^ gr 2 ^ gr 3) shorten_expr (Hexcolor (gr 1 ^ gr 2 ^ gr 3))
(* rgb(r,g,b) -> #rrggbb *) (* rgb(r,g,b) -> #rrggbb *)
| Function ("rgb", Nary (",", [r; g; b])) | Function ("rgb", Nary (",", [r; g; b]))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment