let mix color color' ~percent:x =
let y = 1. -. x in
let (r,g,b),(r',g',b') = rgb_inverse color, rgb_inverse color' in
Graphics.rgb (int_of_float (float r *. y +. float r' *. x))
(int_of_float (float g *. y +. float g' *. x)) (int_of_float (float b *. y +. float b' *. x))