Bladeren bron

Added tiny rgba optimization

Taddeus Kroes 11 jaren geleden
bovenliggende
commit
dcb1102ccf
1 gewijzigde bestanden met toevoegingen van 4 en 0 verwijderingen
  1. 4 0
      color.ml

+ 4 - 0
color.ml

@@ -51,6 +51,10 @@ let rec short = function
   | Function ("rgb", Nary (",", [r; g; b])) ->
     Function ("rgb", Nary (",", [clip r; clip g; clip b]))
 
+  (* rgba(r,g,b,1.0) -> rgb(r,g,b) *)
+  | Function ("rgba", Nary (",", [r; g; b; Number (1., None)])) ->
+    short (Function ("rgb", Nary (",", [r; g; b])))
+
   | v -> v
 
 let transform = function