From 7b59a729b608ce2ccfababea67c6ea7837a8bac6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Am=C3=A9lia=20Coutard-Sander?= Date: Fri, 13 Dec 2024 15:37:32 +0100 Subject: [PATCH] Changement des couleurs de l'automate continu --- automata/automata/cont.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) -- 2.46.0