diff options
author | Sébastien Dailly <sebastien@chimrod.com> | 2020-12-16 14:39:42 +0100 |
---|---|---|
committer | Sébastien Dailly <sebastien@chimrod.com> | 2020-12-16 14:39:42 +0100 |
commit | 4f262d6540281487f79870aff589ca92f5d2f6c6 (patch) | |
tree | 940e59d943715366d1aa72bb93f248dcd65ab992 /theme |
Initial commit
Diffstat (limited to 'theme')
-rwxr-xr-x | theme/dune | 7 | ||||
-rwxr-xr-x | theme/nord.ml | 39 | ||||
-rwxr-xr-x | theme/theme.ml | 1 |
3 files changed, 47 insertions, 0 deletions
diff --git a/theme/dune b/theme/dune new file mode 100755 index 0000000..a812bef --- /dev/null +++ b/theme/dune @@ -0,0 +1,7 @@ +(library + (name theme) + (libraries + color + gg + ) + ) diff --git a/theme/nord.ml b/theme/nord.ml new file mode 100755 index 0000000..4748d83 --- /dev/null +++ b/theme/nord.ml @@ -0,0 +1,39 @@ +open StdLabels + +let default = Color.of_rgb 5 255 255 + +let theme = + [| "#2e3440" + ; "#3b4252" + ; "#434c5e" + ; "#4c566a" + (* Bright *) + ; "#d8dee9" + ; "" + ; "#eceff4" + (* Frost *) + ; "#8fbcbb" + ; "" + ; "" + ; "" + (* Aurora 11 - *) + ; "#bf616a" (* Redd color *) + ; "" + ; "" + ; "#a3be8c" (* Green color *) + + + |] + |> Array.map ~f:(fun f -> + Color.of_hexstring f + |> Option.value ~default + ) + +let set_color t f = + let Color.Rgba'.{r; g; b; _ } = Color.to_rgba' (Array.get theme t) in + f r g b + + +let to_gg t = + let Color.Rgba'.{r; g; b; _ } = Color.to_rgba' (Array.get theme t) in + Gg.Color.of_srgb (Gg.V4.v r g b 1.) diff --git a/theme/theme.ml b/theme/theme.ml new file mode 100755 index 0000000..39974b1 --- /dev/null +++ b/theme/theme.ml @@ -0,0 +1 @@ +module Nord = Nord |