From: Amélia Coutard-Sander Date: Fri, 13 Dec 2024 14:37:32 +0000 (+0100) Subject: Changement des couleurs de l'automate continu X-Git-Url: https://git.ameliathe1st.gay/?a=commitdiff_plain;h=7b59a729b608ce2ccfababea67c6ea7837a8bac6;p=cells.git Changement des couleurs de l'automate continu --- diff --git a/automata/automata/cont.ml b/automata/automata/cont.ml index 88496ec..64c3308 100644 --- a/automata/automata/cont.ml +++ b/automata/automata/cont.ml @@ -28,5 +28,9 @@ let prev c = c -. 1. let next c = c +. 1. let color c = - let v = 256. /. (1. +. Float.exp (-.c)) |> int_of_float |> char_of_int in - (v, v, v) + let v = + (if c > 0. then (512. /. (1. +. Float.exp (-.c))) -. 256. else (512. /. (1. +. Float.exp c)) -. 256.) + |> int_of_float + |> char_of_int + in + if c > 0. then (v, '\x00', '\x00') else ('\x00', '\x00', v)