diff options
author | Joris | 2020-08-08 21:04:28 +0200 |
---|---|---|
committer | Joris | 2020-08-08 21:04:28 +0200 |
commit | 38e42723a916b7d5c2a15e514b3f3e6dcab398dd (patch) | |
tree | 1b7415ae64ac9768b12fc4d543ee61d615d11e7e /src/State.ml | |
parent | 3e39f97d844dbe0ff5f57e3977bc220d366d4c0e (diff) |
Propose already defined colors in the form
Diffstat (limited to 'src/State.ml')
-rw-r--r-- | src/State.ml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/State.ml b/src/State.ml index cc20b16..59391d2 100644 --- a/src/State.ml +++ b/src/State.ml @@ -59,3 +59,14 @@ let from_string str = ("", [| |], [| |]) (Js.Array.from (Js.String.castToArrayLike ((String.decode str) ^ sep))) in res + +(* Colors *) + +let colors = + Js.Array.reduce + (fun colors marker -> + if Js.Array.indexOf marker.color colors == -1 then + Js.Array.concat [| marker.color |] colors + else + colors) + [| |] |