nandi/jolt-nativepublic Fork 0
8e8cd5192dc161b423c0ee5dd41a7a058b24b409
Commits
Clone
git clone https://git.rickub.com/nandi/jolt-native.git
git clone ssh://git@rickub.com/nandi/jolt-native.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Write dvui's shape in jolt, on SDL3, with no shared object 109c7e4 · on 8e8cd5192dc161b423c0ee5dd41a7a058b24b409 · Veronika Winters · 9d ago
theme.clj · 45 lines · 1.4 KBClojure Blame HistoryRaw
 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
40
41
42
43
44
45
(ns jvui.theme
  "Colours and metrics, in one map so a caller can swap the lot.

   Colours are [r g b a] with each channel 0-255, which is what SDL wants and
   what a person reading the file can picture. dvui carries a Theme in its
   Window for the same reason: a widget asks the theme rather than naming a
   constant, so a dark build is a different map and not a different widget.")

(def dark
  {:bg          [24 24 29 255]
   :surface     [34 34 41 255]
   :surface-alt [44 44 53 255]
   :border      [62 62 74 255]
   :text        [226 226 234 255]
   :text-dim    [150 150 165 255]
   :accent      [96 150 255 255]
   :accent-text [255 255 255 255]
   :hover       [54 54 65 255]
   :press       [70 70 84 255]
   :focus       [96 150 255 255]

   :font-size       16.0
   :font-size-title 22.0
   :padding         8.0
   :spacing         6.0
   :radius          6.0
   :border-width    1.0
   :control-height  30.0
   :scrollbar       10.0})

(def light
  (merge dark
         {:bg          [246 246 248 255]
          :surface     [255 255 255 255]
          :surface-alt [238 238 243 255]
          :border      [206 206 214 255]
          :text        [26 26 32 255]
          :text-dim    [110 110 125 255]
          :hover       [232 232 240 255]
          :press       [216 216 228 255]}))

(defn mix
  "`t` of the way from c1 to c2, per channel."
  [c1 c2 t]
  (mapv (fn [a b] (int (+ a (* t (- b a))))) c1 c2))