summaryrefslogtreecommitdiff
path: root/theme/nord.ml
blob: 4748d83a6a63d8c96d674560c7c9a7e08a04c054 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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.)