projects
/
cells.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a0fba20
)
Changement des couleurs de l'automate continu
author
Amélia Coutard-Sander
<git@ameliathe1st.gay>
Fri, 13 Dec 2024 14:37:32 +0000
(15:37 +0100)
committer
Amélia Coutard-Sander
<git@ameliathe1st.gay>
Fri, 13 Dec 2024 15:01:37 +0000
(16:01 +0100)
automata/automata/cont.ml
patch
|
blob
|
history
diff --git
a/automata/automata/cont.ml
b/automata/automata/cont.ml
index 88496ec739285261aa6053cadfd0990e87bad0ae..64c33088e36ff1f998188663a8d8c955b13fbc7b 100644
(file)
--- 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)