monobiome 1.5.0__tar.gz → 1.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {monobiome-1.5.0 → monobiome-1.5.1}/PKG-INFO +35 -34
  2. {monobiome-1.5.0 → monobiome-1.5.1}/README.md +34 -33
  3. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/cli/palette.py +3 -3
  4. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/cli/scheme.py +10 -10
  5. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/constants.py +18 -0
  6. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/plotting.py +39 -26
  7. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome.egg-info/PKG-INFO +35 -34
  8. {monobiome-1.5.0 → monobiome-1.5.1}/pyproject.toml +1 -1
  9. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/__init__.py +0 -0
  10. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/__main__.py +0 -0
  11. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/cli/__init__.py +0 -0
  12. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/cli/fill.py +0 -0
  13. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/curve.py +0 -0
  14. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/data/parameters.toml +0 -0
  15. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/palette.py +0 -0
  16. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/scheme.py +0 -0
  17. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome/util.py +0 -0
  18. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome.egg-info/SOURCES.txt +0 -0
  19. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome.egg-info/dependency_links.txt +0 -0
  20. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome.egg-info/entry_points.txt +0 -0
  21. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome.egg-info/requires.txt +0 -0
  22. {monobiome-1.5.0 → monobiome-1.5.1}/monobiome.egg-info/top_level.txt +0 -0
  23. {monobiome-1.5.0 → monobiome-1.5.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: monobiome
3
- Version: 1.5.0
3
+ Version: 1.5.1
4
4
  Summary: Monobiome color palette
5
5
  Author-email: Sam Griesemer <git@olog.io>
6
6
  License-Expression: MIT
@@ -70,13 +70,13 @@ both of which have fixed hue values and vary from 10% to 98% lightness.
70
70
  Monotone curves have fixed chroma, whereas the accent curves' chroma varies
71
71
  smoothly as a function of lightness within sRGB gamut bounds.
72
72
 
73
- | Chroma curves | Color trajectories |
74
- |---|---|
75
- | ![Chroma curves](images/curves/cstar-curves-v140.png) | ![Trajectories](images/trajectories.gif) |
73
+ | Chroma curves | Color trajectories |
74
+ |----------------------------------------------------------|------------------------------------------|
75
+ | ![Chroma curves](images/release/1.5.1/chroma-curves.png) | ![Trajectories](images/trajectories.gif) |
76
76
 
77
- | Palette |
78
- |---|
79
- | ![Palette](images/palette.png) |
77
+ | Palette |
78
+ |----------------------------------------------|
79
+ | ![Palette](images/release/1.5.1/palette.png) |
80
80
 
81
81
  Chroma curves are designed specifically to establish a distinct role for each
82
82
  accent and are non-intersecting over the lightness domain (hence the distinct
@@ -100,8 +100,8 @@ varying only in lightness from dark to light grey.
100
100
 
101
101
  ## Themes
102
102
 
103
- | Dark themes | Light themes |
104
- |---|---|
103
+ | Dark themes | Light themes |
104
+ |----------------------------------------|------------------------------------------|
105
105
  | ![Dark themes](images/dark_themes.png) | ![Light themes](images/light_themes.png) |
106
106
 
107
107
  Themes are derived from the `monobiome` palette by selecting a monotone base
@@ -118,10 +118,10 @@ to the background.
118
118
  The following plots show the intersection of the sphere centered at a fixed
119
119
  background color (`alpine` biome with a lightness of 20) under variable radii:
120
120
 
121
- | | `-l 20 -d 0.3` | `-l 20 -d 0.4` | `-l 20 -d 0.5` |
122
- |---|---|---|---|
123
- | Color visualization | ![](images/oklch/mb_b20_d30.gif) | ![](images/oklch/mb_b20_d40.gif) | ![](images/oklch/mb_b20_d50.gif) |
124
- | Editor preview | ![](images/render/v140-demo-alpine-dark-d0.3.png) | ![](images/render/v140-demo-alpine-dark-d0.4.png) | ![](images/render/v140-demo-alpine-dark-d0.5.png) |
121
+ | | `-l 20 -d 0.3` | `-l 20 -d 0.4` | `-l 20 -d 0.5` |
122
+ |---------------------|---------------------------------------------------|---------------------------------------------------|---------------------------------------------------|
123
+ | Color visualization | ![](images/oklch/mb_b20_d30.gif) | ![](images/oklch/mb_b20_d40.gif) | ![](images/oklch/mb_b20_d50.gif) |
124
+ | Editor preview | ![](images/render/v140-demo-alpine-dark-d0.3.png) | ![](images/render/v140-demo-alpine-dark-d0.4.png) | ![](images/render/v140-demo-alpine-dark-d0.5.png) |
125
125
 
126
126
  In short, the base lightness (`-l`) dictates the brightness of the background,
127
127
  and the contrast (`-d`) controls how perceptually distinct the accent colors
@@ -157,10 +157,10 @@ theme pipeline can be seen in detail below:
157
157
  ![Generation pipeline](images/theme_generation_pipeline.png)
158
158
 
159
159
  This figure demonstrates how `kitty` themes are generated, but the process is
160
- generic to any palette, scheme, and app. This implemented in two stages using
161
- the `monobiome` CLI:
160
+ generic to any palette, scheme, and app. This is implemented in two stages
161
+ using the `monobiome` CLI:
162
162
 
163
- - First generate the scheme file, the definitions that respect perceptual
163
+ - First generate the scheme file, the lightness choices that achieve perceptual
164
164
  uniformity of accents with respect to the base monotone:
165
165
 
166
166
  ```sh
@@ -177,19 +177,14 @@ the `monobiome` CLI:
177
177
  monobiome fill scheme.toml templates/kitty/active.theme -o kitty.theme
178
178
  ```
179
179
 
180
- This writes a concrete theme to `kitty.theme` that matches the user
181
- preferences, i.e., the contrast (`-d`), background lightness (`-l`), mode
182
- (`dark`), and biome (`grassland`). Every part of this process can be
183
- customized: the scheme parameters, the scheme definitions/file, the app
184
- template.
180
+ This writes a concrete `kitty` theme to `kitty.theme` that matches the user
181
+ preferences as captured in the previously generated scheme file, i.e., the
182
+ contrast (`-d`), background lightness (`-l`), mode (`dark`), and biome
183
+ (`grassland`). Every part of this process can be customized: the scheme
184
+ parameters, the scheme definitions/file, the app template.
185
185
 
186
186
  Running these commands in sequence from the repo root should work
187
- out-of-the-box, after having installed the CLI tool.
188
-
189
- The `monobiome` CLI
190
- produces the scheme file for requested parameters, and the [`symconf`][3] CLI
191
- pushes palette colors through the scheme and into the app templates to yield a
192
- concrete theme.
187
+ out-of-the-box after having installed the CLI tool.
193
188
 
194
189
  ## Applications
195
190
  This repo provides palette-agnostic theme templates for `kitty`,
@@ -218,7 +213,7 @@ One can set these themes for the provided applications as follows:
218
213
  ```
219
214
 
220
215
  Themes are generated using the [`kitty` theme
221
- template](templates/apps/kitty/templates/active.theme).
216
+ template](templates/kitty/active.theme).
222
217
 
223
218
  - `vim`/`neovim`
224
219
 
@@ -233,7 +228,7 @@ One can set these themes for the provided applications as follows:
233
228
  ```
234
229
 
235
230
  Themes are generated using the [`vim` theme
236
- template](templates/apps/nvim/templates/theme.vim).
231
+ template](templates/nvim/theme.vim).
237
232
 
238
233
  - `fzf`
239
234
 
@@ -246,7 +241,7 @@ One can set these themes for the provided applications as follows:
246
241
  ```
247
242
 
248
243
  Themes are generated using the [`fzf` theme
249
- template](templates/apps/fzf/templates/active.theme).
244
+ template](templates/fzf/active.theme).
250
245
 
251
246
  - Firefox
252
247
 
@@ -254,13 +249,11 @@ One can set these themes for the provided applications as follows:
254
249
  add-ons][2], and switch between light/dark schemes based on system settings.
255
250
  You can also download raw XPI files for each theme in `app-config/firefox/`,
256
251
  each of which is generated using the [Firefox `manifest.json`
257
- template](templates/apps/firefox/templates/none-dark.manifest.json).
252
+ template](templates/firefox/auto-manifest.json).
258
253
 
259
254
  Static [light][4] and [dark][5] themes are additionally available (i.e., that
260
255
  don't change with system settings).
261
256
 
262
- ![Firefox theme previews](images/firefox/themes.png)
263
-
264
257
  ## CLI installation
265
258
  A brief theme generation guide was provided in the [Generation
266
259
  section](#generation), making use of the `monobiome` CLI. This tool can be
@@ -272,7 +265,7 @@ uv tool install monobiome
272
265
  pipx install monobiome
273
266
  ```
274
267
 
275
- The `monobiome` has provides three subcommands:
268
+ `monobiome` provides three subcommands:
276
269
 
277
270
  - `monobiome palette`: generate palette files from raw parameterized curves
278
271
 
@@ -335,6 +328,14 @@ The `monobiome` has provides three subcommands:
335
328
  output file to write filled template
336
329
  ```
337
330
 
331
+ ## Config management
332
+ The `monobiome` CLI tool attempts to provide the minimal functionality needed
333
+ to produce customized themes for individual applications. If seeking a more
334
+ holistic, system-wide approach, you might consider using [`symconf`][3], a
335
+ general-purpose application config manager. `symconf` provides the templating
336
+ subsystem used for `monobiome` internals, and can be configured to apply live
337
+ theme updates to many apps with a single command line invocation.
338
+
338
339
 
339
340
  [1]: https://github.com/isa/TextMate-Themes/blob/master/monoindustrial.tmTheme
340
341
  [2]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome/
@@ -30,13 +30,13 @@ both of which have fixed hue values and vary from 10% to 98% lightness.
30
30
  Monotone curves have fixed chroma, whereas the accent curves' chroma varies
31
31
  smoothly as a function of lightness within sRGB gamut bounds.
32
32
 
33
- | Chroma curves | Color trajectories |
34
- |---|---|
35
- | ![Chroma curves](images/curves/cstar-curves-v140.png) | ![Trajectories](images/trajectories.gif) |
33
+ | Chroma curves | Color trajectories |
34
+ |----------------------------------------------------------|------------------------------------------|
35
+ | ![Chroma curves](images/release/1.5.1/chroma-curves.png) | ![Trajectories](images/trajectories.gif) |
36
36
 
37
- | Palette |
38
- |---|
39
- | ![Palette](images/palette.png) |
37
+ | Palette |
38
+ |----------------------------------------------|
39
+ | ![Palette](images/release/1.5.1/palette.png) |
40
40
 
41
41
  Chroma curves are designed specifically to establish a distinct role for each
42
42
  accent and are non-intersecting over the lightness domain (hence the distinct
@@ -60,8 +60,8 @@ varying only in lightness from dark to light grey.
60
60
 
61
61
  ## Themes
62
62
 
63
- | Dark themes | Light themes |
64
- |---|---|
63
+ | Dark themes | Light themes |
64
+ |----------------------------------------|------------------------------------------|
65
65
  | ![Dark themes](images/dark_themes.png) | ![Light themes](images/light_themes.png) |
66
66
 
67
67
  Themes are derived from the `monobiome` palette by selecting a monotone base
@@ -78,10 +78,10 @@ to the background.
78
78
  The following plots show the intersection of the sphere centered at a fixed
79
79
  background color (`alpine` biome with a lightness of 20) under variable radii:
80
80
 
81
- | | `-l 20 -d 0.3` | `-l 20 -d 0.4` | `-l 20 -d 0.5` |
82
- |---|---|---|---|
83
- | Color visualization | ![](images/oklch/mb_b20_d30.gif) | ![](images/oklch/mb_b20_d40.gif) | ![](images/oklch/mb_b20_d50.gif) |
84
- | Editor preview | ![](images/render/v140-demo-alpine-dark-d0.3.png) | ![](images/render/v140-demo-alpine-dark-d0.4.png) | ![](images/render/v140-demo-alpine-dark-d0.5.png) |
81
+ | | `-l 20 -d 0.3` | `-l 20 -d 0.4` | `-l 20 -d 0.5` |
82
+ |---------------------|---------------------------------------------------|---------------------------------------------------|---------------------------------------------------|
83
+ | Color visualization | ![](images/oklch/mb_b20_d30.gif) | ![](images/oklch/mb_b20_d40.gif) | ![](images/oklch/mb_b20_d50.gif) |
84
+ | Editor preview | ![](images/render/v140-demo-alpine-dark-d0.3.png) | ![](images/render/v140-demo-alpine-dark-d0.4.png) | ![](images/render/v140-demo-alpine-dark-d0.5.png) |
85
85
 
86
86
  In short, the base lightness (`-l`) dictates the brightness of the background,
87
87
  and the contrast (`-d`) controls how perceptually distinct the accent colors
@@ -117,10 +117,10 @@ theme pipeline can be seen in detail below:
117
117
  ![Generation pipeline](images/theme_generation_pipeline.png)
118
118
 
119
119
  This figure demonstrates how `kitty` themes are generated, but the process is
120
- generic to any palette, scheme, and app. This implemented in two stages using
121
- the `monobiome` CLI:
120
+ generic to any palette, scheme, and app. This is implemented in two stages
121
+ using the `monobiome` CLI:
122
122
 
123
- - First generate the scheme file, the definitions that respect perceptual
123
+ - First generate the scheme file, the lightness choices that achieve perceptual
124
124
  uniformity of accents with respect to the base monotone:
125
125
 
126
126
  ```sh
@@ -137,19 +137,14 @@ the `monobiome` CLI:
137
137
  monobiome fill scheme.toml templates/kitty/active.theme -o kitty.theme
138
138
  ```
139
139
 
140
- This writes a concrete theme to `kitty.theme` that matches the user
141
- preferences, i.e., the contrast (`-d`), background lightness (`-l`), mode
142
- (`dark`), and biome (`grassland`). Every part of this process can be
143
- customized: the scheme parameters, the scheme definitions/file, the app
144
- template.
140
+ This writes a concrete `kitty` theme to `kitty.theme` that matches the user
141
+ preferences as captured in the previously generated scheme file, i.e., the
142
+ contrast (`-d`), background lightness (`-l`), mode (`dark`), and biome
143
+ (`grassland`). Every part of this process can be customized: the scheme
144
+ parameters, the scheme definitions/file, the app template.
145
145
 
146
146
  Running these commands in sequence from the repo root should work
147
- out-of-the-box, after having installed the CLI tool.
148
-
149
- The `monobiome` CLI
150
- produces the scheme file for requested parameters, and the [`symconf`][3] CLI
151
- pushes palette colors through the scheme and into the app templates to yield a
152
- concrete theme.
147
+ out-of-the-box after having installed the CLI tool.
153
148
 
154
149
  ## Applications
155
150
  This repo provides palette-agnostic theme templates for `kitty`,
@@ -178,7 +173,7 @@ One can set these themes for the provided applications as follows:
178
173
  ```
179
174
 
180
175
  Themes are generated using the [`kitty` theme
181
- template](templates/apps/kitty/templates/active.theme).
176
+ template](templates/kitty/active.theme).
182
177
 
183
178
  - `vim`/`neovim`
184
179
 
@@ -193,7 +188,7 @@ One can set these themes for the provided applications as follows:
193
188
  ```
194
189
 
195
190
  Themes are generated using the [`vim` theme
196
- template](templates/apps/nvim/templates/theme.vim).
191
+ template](templates/nvim/theme.vim).
197
192
 
198
193
  - `fzf`
199
194
 
@@ -206,7 +201,7 @@ One can set these themes for the provided applications as follows:
206
201
  ```
207
202
 
208
203
  Themes are generated using the [`fzf` theme
209
- template](templates/apps/fzf/templates/active.theme).
204
+ template](templates/fzf/active.theme).
210
205
 
211
206
  - Firefox
212
207
 
@@ -214,13 +209,11 @@ One can set these themes for the provided applications as follows:
214
209
  add-ons][2], and switch between light/dark schemes based on system settings.
215
210
  You can also download raw XPI files for each theme in `app-config/firefox/`,
216
211
  each of which is generated using the [Firefox `manifest.json`
217
- template](templates/apps/firefox/templates/none-dark.manifest.json).
212
+ template](templates/firefox/auto-manifest.json).
218
213
 
219
214
  Static [light][4] and [dark][5] themes are additionally available (i.e., that
220
215
  don't change with system settings).
221
216
 
222
- ![Firefox theme previews](images/firefox/themes.png)
223
-
224
217
  ## CLI installation
225
218
  A brief theme generation guide was provided in the [Generation
226
219
  section](#generation), making use of the `monobiome` CLI. This tool can be
@@ -232,7 +225,7 @@ uv tool install monobiome
232
225
  pipx install monobiome
233
226
  ```
234
227
 
235
- The `monobiome` has provides three subcommands:
228
+ `monobiome` provides three subcommands:
236
229
 
237
230
  - `monobiome palette`: generate palette files from raw parameterized curves
238
231
 
@@ -295,6 +288,14 @@ The `monobiome` has provides three subcommands:
295
288
  output file to write filled template
296
289
  ```
297
290
 
291
+ ## Config management
292
+ The `monobiome` CLI tool attempts to provide the minimal functionality needed
293
+ to produce customized themes for individual applications. If seeking a more
294
+ holistic, system-wide approach, you might consider using [`symconf`][3], a
295
+ general-purpose application config manager. `symconf` provides the templating
296
+ subsystem used for `monobiome` internals, and can be configured to apply live
297
+ theme updates to many apps with a single command line invocation.
298
+
298
299
 
299
300
  [1]: https://github.com/isa/TextMate-Themes/blob/master/monoindustrial.tmTheme
300
301
  [2]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome/
@@ -17,7 +17,7 @@ def register_parser(subparsers: _SubparserType) -> None:
17
17
  type=str,
18
18
  default="hex",
19
19
  choices=["hex", "oklch"],
20
- help="Color notation to export (either hex or oklch)",
20
+ help="color notation to export (either hex or oklch)",
21
21
  )
22
22
  parser.add_argument(
23
23
  "-f",
@@ -25,13 +25,13 @@ def register_parser(subparsers: _SubparserType) -> None:
25
25
  type=str,
26
26
  default="toml",
27
27
  choices=["json", "toml"],
28
- help="Format of palette file (either JSON or TOML)",
28
+ help="format of palette file (either JSON or TOML)",
29
29
  )
30
30
  parser.add_argument(
31
31
  "-o",
32
32
  "--output",
33
33
  type=str,
34
- help="Output file to write palette content",
34
+ help="output file to write palette content",
35
35
  )
36
36
 
37
37
  parser.set_defaults(func=handle_palette)
@@ -16,13 +16,13 @@ def register_parser(subparsers: _SubparserType) -> None:
16
16
  "mode",
17
17
  type=str,
18
18
  choices=["dark", "light"],
19
- help="Scheme mode (light or dark)"
19
+ help="scheme mode (light or dark)"
20
20
  )
21
21
  parser.add_argument(
22
22
  "biome",
23
23
  type=str,
24
24
  choices=list(monotone_h_map.keys()),
25
- help="Biome setting for scheme."
25
+ help="biome setting for scheme"
26
26
  )
27
27
  parser.add_argument(
28
28
  "-m",
@@ -30,7 +30,7 @@ def register_parser(subparsers: _SubparserType) -> None:
30
30
  type=str,
31
31
  default="oklch",
32
32
  choices=["wcag", "oklch", "lightness"],
33
- help="Metric to use for measuring swatch distances."
33
+ help="metric to use for measuring swatch distances"
34
34
  )
35
35
 
36
36
  # e.g., wcag=4.5; oklch=0.40; lightness=40
@@ -39,13 +39,13 @@ def register_parser(subparsers: _SubparserType) -> None:
39
39
  "--distance",
40
40
  type=float,
41
41
  default=0.40,
42
- help="Distance threshold for specified metric",
42
+ help="distance threshold for specified metric",
43
43
  )
44
44
  parser.add_argument(
45
45
  "-o",
46
46
  "--output",
47
47
  type=str,
48
- help="Output file to write scheme content",
48
+ help="output file to write scheme content",
49
49
  )
50
50
 
51
51
  # these params remain rooted in lightness; no need to accommodate metric
@@ -58,13 +58,13 @@ def register_parser(subparsers: _SubparserType) -> None:
58
58
  "--l-base",
59
59
  type=int,
60
60
  default=20,
61
- help="Minimum lightness level (default: 20)",
61
+ help="minimum lightness level (default: 20)",
62
62
  )
63
63
  parser.add_argument(
64
64
  "--l-step",
65
65
  type=int,
66
66
  default=5,
67
- help="Lightness step size (default: 5)",
67
+ help="lightness step size (default: 5)",
68
68
  )
69
69
 
70
70
  # gaps
@@ -72,19 +72,19 @@ def register_parser(subparsers: _SubparserType) -> None:
72
72
  "--fg-gap",
73
73
  type=int,
74
74
  default=50,
75
- help="Foreground lightness gap (default: 50)",
75
+ help="foreground lightness gap (default: 50)",
76
76
  )
77
77
  parser.add_argument(
78
78
  "--grey-gap",
79
79
  type=int,
80
80
  default=30,
81
- help="Grey lightness gap (default: 30)",
81
+ help="grey lightness gap (default: 30)",
82
82
  )
83
83
  parser.add_argument(
84
84
  "--term-fg-gap",
85
85
  type=int,
86
86
  default=65,
87
- help="Terminal foreground lightness gap (default: 60)",
87
+ help="terminal foreground lightness gap (default: 60)",
88
88
  )
89
89
 
90
90
  parser.set_defaults(func=handle_scheme)
@@ -121,3 +121,21 @@ for h_str, L_points_C in Lpoints_Cqbr_Hmap.items():
121
121
  max(0, min(_C, l_maxC_h(_L, _h)))
122
122
  for _L, _C in zip(L_points, L_points_C, strict=True)
123
123
  ]
124
+
125
+
126
+ # strictly enforce curve bounds s.t. there are no intersections
127
+ # order is determined by the max attained chromap
128
+ max_Cstar_Horder = [
129
+ (h_str, max(Lpoints_Cstar))
130
+ for h_str, Lpoints_Cstar in Lpoints_Cstar_Hmap.items()
131
+ ]
132
+ max_Cstar_Horder = sorted(max_Cstar_Horder, key=lambda t: t[1], reverse=True)
133
+
134
+ for i in range(len(max_Cstar_Horder)-1):
135
+ outer_h, _ = max_Cstar_Horder[i]
136
+ inner_h, _ = max_Cstar_Horder[i+1]
137
+
138
+ Lpoints_Cstar_Hmap[inner_h] = [
139
+ min(inner_c, Lpoints_Cstar_Hmap[outer_h][ci])
140
+ for ci, inner_c in enumerate(Lpoints_Cstar_Hmap[inner_h])
141
+ ]
@@ -1,6 +1,9 @@
1
+ from importlib.metadata import version
2
+
1
3
  import numpy as np
2
4
  import matplotlib.pyplot as plt
3
5
  from coloraide import Color
6
+ from matplotlib.collections import LineCollection
4
7
 
5
8
  from monobiome.palette import compute_hlc_map
6
9
  from monobiome.constants import (
@@ -10,11 +13,13 @@ from monobiome.constants import (
10
13
  accent_h_map,
11
14
  monotone_h_map,
12
15
  Lspace_Cmax_Hmap,
16
+ max_Cstar_Horder,
13
17
  Lpoints_Cstar_Hmap,
14
18
  )
15
19
 
20
+ VERSION = version("monobiome")
16
21
 
17
- def plot_hue_chroma_bounds() -> None:
22
+ def plot_hue_chroma_bounds() -> tuple[plt.Figure, plt.Axes]:
18
23
  name_h_map = {}
19
24
  ax_h_map = {}
20
25
  fig, axes = plt.subplots(
@@ -63,43 +68,54 @@ def plot_hue_chroma_bounds() -> None:
63
68
  ncol=3
64
69
  )
65
70
 
66
- plt.suptitle("$C^*$ curves for hue groups")
67
- plt.show()
71
+ plt.suptitle(f"$C^*$ curves for hue groups (v{VERSION})")
68
72
 
73
+ return fig, axes
69
74
 
70
- def plot_hue_chroma_star() -> None:
75
+ def plot_hue_chroma_star() -> tuple[plt.Figure, plt.Axes]:
71
76
  fig, ax = plt.subplots(1, 1, figsize=(8, 6))
72
77
 
73
- # uncomment to preview 5 core term colors
74
78
  colors = accent_h_map.keys()
75
- #colors = set(["red", "orange", "yellow", "green", "blue"])
79
+ # uncomment to preview just the 5 core term colors
80
+ # colors = set(["red", "orange", "yellow", "green", "blue"])
81
+
82
+ for h_str, _ in max_Cstar_Horder:
83
+ Lpoints_Cstar = Lpoints_Cstar_Hmap[h_str]
76
84
 
77
- for h_str in Lpoints_Cstar_Hmap:
78
85
  if h_str not in accent_h_map or h_str not in colors:
79
86
  continue
80
- ax.fill_between(
81
- L_points,
82
- Lpoints_Cstar_Hmap[h_str],
83
- alpha=0.2,
84
- color='grey',
85
- label=h_str
86
- )
87
-
88
- x, y = L_points, Lpoints_Cstar_Hmap[h_str]
89
- n = int(0.45*len(x))
90
- ax.text(x[n], y[n]-0.01, h_str, rotation=10, va='center', ha='left')
87
+
88
+ _h = h_map[h_str]
89
+ h_colors = [
90
+ Color('oklch', [_l/100, _c, _h]).convert("srgb")
91
+ for _l, _c in zip(L_points, Lpoints_Cstar, strict=True)
92
+ ]
93
+
94
+ x = np.asarray(L_points)
95
+ y = np.asarray(Lpoints_Cstar)
96
+ pts = np.column_stack([x, y]).reshape(-1, 1, 2)
97
+ segs = np.concatenate([pts[:-1], pts[1:]], axis=1)
98
+ rgb = np.asarray(h_colors)
99
+ seg_colors = (rgb[:-1] + rgb[1:]) / 2
100
+ lc = LineCollection(segs, colors=seg_colors, linewidth=3,
101
+ capstyle="round", joinstyle="round",
102
+ label=h_str)
103
+
104
+ ax.add_collection(lc)
105
+ ax.autoscale_view()
91
106
 
92
107
  ax.set_xlabel("Lightness (%)")
93
108
  ax.set_xticks([L_points[0], 45, 50, 55, 60, 65, 70, L_points[-1]])
94
- plt.suptitle("$C^*$ curves (v1.4.0)")
95
- fig.show()
96
109
 
110
+ plt.suptitle(f"$C^*$ curves (v{VERSION})")
111
+
112
+ return fig, ax
97
113
 
98
114
  def palette_image(
99
115
  palette: dict[str, dict[int, str]],
100
116
  cell_size: int = 40,
101
117
  keys: list[str] | None = None
102
- ) -> tuple[np.ndarray, list[str], list[list[int]], int, int]:
118
+ ) -> tuple[np.ndarray, list[str], list[list[int]]]:
103
119
  names = list(palette.keys()) if keys is None else keys
104
120
 
105
121
  row_count = len(names)
@@ -123,8 +139,7 @@ def palette_image(
123
139
  c0, c1 = c * cell_size, (c + 1) * cell_size
124
140
  img[r0:r1, c0:c1, :] = rgb
125
141
 
126
- return img, names, lightness_keys_per_row, cell_size, max_cols
127
-
142
+ return img, names, lightness_keys_per_row
128
143
 
129
144
  def show_palette(
130
145
  palette: dict[str, dict[int, str]],
@@ -133,9 +148,7 @@ def show_palette(
133
148
  show_labels: bool = True,
134
149
  dpi: int = 100,
135
150
  ) -> tuple[plt.Figure, plt.Axes]:
136
- img, names, keys, cell_size, max_cols = palette_image(
137
- palette, cell_size, keys=keys
138
- )
151
+ img, names, _ = palette_image(palette, cell_size, keys=keys)
139
152
 
140
153
  fig_w = img.shape[1] / 100
141
154
  fig_h = img.shape[0] / 100
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: monobiome
3
- Version: 1.5.0
3
+ Version: 1.5.1
4
4
  Summary: Monobiome color palette
5
5
  Author-email: Sam Griesemer <git@olog.io>
6
6
  License-Expression: MIT
@@ -70,13 +70,13 @@ both of which have fixed hue values and vary from 10% to 98% lightness.
70
70
  Monotone curves have fixed chroma, whereas the accent curves' chroma varies
71
71
  smoothly as a function of lightness within sRGB gamut bounds.
72
72
 
73
- | Chroma curves | Color trajectories |
74
- |---|---|
75
- | ![Chroma curves](images/curves/cstar-curves-v140.png) | ![Trajectories](images/trajectories.gif) |
73
+ | Chroma curves | Color trajectories |
74
+ |----------------------------------------------------------|------------------------------------------|
75
+ | ![Chroma curves](images/release/1.5.1/chroma-curves.png) | ![Trajectories](images/trajectories.gif) |
76
76
 
77
- | Palette |
78
- |---|
79
- | ![Palette](images/palette.png) |
77
+ | Palette |
78
+ |----------------------------------------------|
79
+ | ![Palette](images/release/1.5.1/palette.png) |
80
80
 
81
81
  Chroma curves are designed specifically to establish a distinct role for each
82
82
  accent and are non-intersecting over the lightness domain (hence the distinct
@@ -100,8 +100,8 @@ varying only in lightness from dark to light grey.
100
100
 
101
101
  ## Themes
102
102
 
103
- | Dark themes | Light themes |
104
- |---|---|
103
+ | Dark themes | Light themes |
104
+ |----------------------------------------|------------------------------------------|
105
105
  | ![Dark themes](images/dark_themes.png) | ![Light themes](images/light_themes.png) |
106
106
 
107
107
  Themes are derived from the `monobiome` palette by selecting a monotone base
@@ -118,10 +118,10 @@ to the background.
118
118
  The following plots show the intersection of the sphere centered at a fixed
119
119
  background color (`alpine` biome with a lightness of 20) under variable radii:
120
120
 
121
- | | `-l 20 -d 0.3` | `-l 20 -d 0.4` | `-l 20 -d 0.5` |
122
- |---|---|---|---|
123
- | Color visualization | ![](images/oklch/mb_b20_d30.gif) | ![](images/oklch/mb_b20_d40.gif) | ![](images/oklch/mb_b20_d50.gif) |
124
- | Editor preview | ![](images/render/v140-demo-alpine-dark-d0.3.png) | ![](images/render/v140-demo-alpine-dark-d0.4.png) | ![](images/render/v140-demo-alpine-dark-d0.5.png) |
121
+ | | `-l 20 -d 0.3` | `-l 20 -d 0.4` | `-l 20 -d 0.5` |
122
+ |---------------------|---------------------------------------------------|---------------------------------------------------|---------------------------------------------------|
123
+ | Color visualization | ![](images/oklch/mb_b20_d30.gif) | ![](images/oklch/mb_b20_d40.gif) | ![](images/oklch/mb_b20_d50.gif) |
124
+ | Editor preview | ![](images/render/v140-demo-alpine-dark-d0.3.png) | ![](images/render/v140-demo-alpine-dark-d0.4.png) | ![](images/render/v140-demo-alpine-dark-d0.5.png) |
125
125
 
126
126
  In short, the base lightness (`-l`) dictates the brightness of the background,
127
127
  and the contrast (`-d`) controls how perceptually distinct the accent colors
@@ -157,10 +157,10 @@ theme pipeline can be seen in detail below:
157
157
  ![Generation pipeline](images/theme_generation_pipeline.png)
158
158
 
159
159
  This figure demonstrates how `kitty` themes are generated, but the process is
160
- generic to any palette, scheme, and app. This implemented in two stages using
161
- the `monobiome` CLI:
160
+ generic to any palette, scheme, and app. This is implemented in two stages
161
+ using the `monobiome` CLI:
162
162
 
163
- - First generate the scheme file, the definitions that respect perceptual
163
+ - First generate the scheme file, the lightness choices that achieve perceptual
164
164
  uniformity of accents with respect to the base monotone:
165
165
 
166
166
  ```sh
@@ -177,19 +177,14 @@ the `monobiome` CLI:
177
177
  monobiome fill scheme.toml templates/kitty/active.theme -o kitty.theme
178
178
  ```
179
179
 
180
- This writes a concrete theme to `kitty.theme` that matches the user
181
- preferences, i.e., the contrast (`-d`), background lightness (`-l`), mode
182
- (`dark`), and biome (`grassland`). Every part of this process can be
183
- customized: the scheme parameters, the scheme definitions/file, the app
184
- template.
180
+ This writes a concrete `kitty` theme to `kitty.theme` that matches the user
181
+ preferences as captured in the previously generated scheme file, i.e., the
182
+ contrast (`-d`), background lightness (`-l`), mode (`dark`), and biome
183
+ (`grassland`). Every part of this process can be customized: the scheme
184
+ parameters, the scheme definitions/file, the app template.
185
185
 
186
186
  Running these commands in sequence from the repo root should work
187
- out-of-the-box, after having installed the CLI tool.
188
-
189
- The `monobiome` CLI
190
- produces the scheme file for requested parameters, and the [`symconf`][3] CLI
191
- pushes palette colors through the scheme and into the app templates to yield a
192
- concrete theme.
187
+ out-of-the-box after having installed the CLI tool.
193
188
 
194
189
  ## Applications
195
190
  This repo provides palette-agnostic theme templates for `kitty`,
@@ -218,7 +213,7 @@ One can set these themes for the provided applications as follows:
218
213
  ```
219
214
 
220
215
  Themes are generated using the [`kitty` theme
221
- template](templates/apps/kitty/templates/active.theme).
216
+ template](templates/kitty/active.theme).
222
217
 
223
218
  - `vim`/`neovim`
224
219
 
@@ -233,7 +228,7 @@ One can set these themes for the provided applications as follows:
233
228
  ```
234
229
 
235
230
  Themes are generated using the [`vim` theme
236
- template](templates/apps/nvim/templates/theme.vim).
231
+ template](templates/nvim/theme.vim).
237
232
 
238
233
  - `fzf`
239
234
 
@@ -246,7 +241,7 @@ One can set these themes for the provided applications as follows:
246
241
  ```
247
242
 
248
243
  Themes are generated using the [`fzf` theme
249
- template](templates/apps/fzf/templates/active.theme).
244
+ template](templates/fzf/active.theme).
250
245
 
251
246
  - Firefox
252
247
 
@@ -254,13 +249,11 @@ One can set these themes for the provided applications as follows:
254
249
  add-ons][2], and switch between light/dark schemes based on system settings.
255
250
  You can also download raw XPI files for each theme in `app-config/firefox/`,
256
251
  each of which is generated using the [Firefox `manifest.json`
257
- template](templates/apps/firefox/templates/none-dark.manifest.json).
252
+ template](templates/firefox/auto-manifest.json).
258
253
 
259
254
  Static [light][4] and [dark][5] themes are additionally available (i.e., that
260
255
  don't change with system settings).
261
256
 
262
- ![Firefox theme previews](images/firefox/themes.png)
263
-
264
257
  ## CLI installation
265
258
  A brief theme generation guide was provided in the [Generation
266
259
  section](#generation), making use of the `monobiome` CLI. This tool can be
@@ -272,7 +265,7 @@ uv tool install monobiome
272
265
  pipx install monobiome
273
266
  ```
274
267
 
275
- The `monobiome` has provides three subcommands:
268
+ `monobiome` provides three subcommands:
276
269
 
277
270
  - `monobiome palette`: generate palette files from raw parameterized curves
278
271
 
@@ -335,6 +328,14 @@ The `monobiome` has provides three subcommands:
335
328
  output file to write filled template
336
329
  ```
337
330
 
331
+ ## Config management
332
+ The `monobiome` CLI tool attempts to provide the minimal functionality needed
333
+ to produce customized themes for individual applications. If seeking a more
334
+ holistic, system-wide approach, you might consider using [`symconf`][3], a
335
+ general-purpose application config manager. `symconf` provides the templating
336
+ subsystem used for `monobiome` internals, and can be configured to apply live
337
+ theme updates to many apps with a single command line invocation.
338
+
338
339
 
339
340
  [1]: https://github.com/isa/TextMate-Themes/blob/master/monoindustrial.tmTheme
340
341
  [2]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome/
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "monobiome"
7
- version = "1.5.0"
7
+ version = "1.5.1"
8
8
  description = "Monobiome color palette"
9
9
  requires-python = ">=3.12"
10
10
  authors = [
File without changes
File without changes
File without changes
File without changes