monobiome 1.4.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 (26) hide show
  1. monobiome-1.5.1/PKG-INFO +344 -0
  2. monobiome-1.5.1/README.md +304 -0
  3. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/__main__.py +1 -1
  4. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/cli/__init__.py +6 -5
  5. monobiome-1.5.1/monobiome/cli/fill.py +78 -0
  6. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/cli/palette.py +5 -5
  7. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/cli/scheme.py +12 -12
  8. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/constants.py +18 -0
  9. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/curve.py +3 -3
  10. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/palette.py +3 -2
  11. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/plotting.py +71 -39
  12. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/scheme.py +14 -8
  13. monobiome-1.5.1/monobiome.egg-info/PKG-INFO +344 -0
  14. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome.egg-info/SOURCES.txt +1 -0
  15. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome.egg-info/requires.txt +14 -1
  16. {monobiome-1.4.0 → monobiome-1.5.1}/pyproject.toml +34 -9
  17. monobiome-1.4.0/PKG-INFO +0 -232
  18. monobiome-1.4.0/README.md +0 -210
  19. monobiome-1.4.0/monobiome.egg-info/PKG-INFO +0 -232
  20. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/__init__.py +0 -0
  21. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/data/parameters.toml +0 -0
  22. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome/util.py +0 -0
  23. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome.egg-info/dependency_links.txt +0 -0
  24. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome.egg-info/entry_points.txt +0 -0
  25. {monobiome-1.4.0 → monobiome-1.5.1}/monobiome.egg-info/top_level.txt +0 -0
  26. {monobiome-1.4.0 → monobiome-1.5.1}/setup.cfg +0 -0
@@ -0,0 +1,344 @@
1
+ Metadata-Version: 2.4
2
+ Name: monobiome
3
+ Version: 1.5.1
4
+ Summary: Monobiome color palette
5
+ Author-email: Sam Griesemer <git@olog.io>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://doc.olog.io/monobiome
8
+ Project-URL: Documentation, https://doc.olog.io/monobiome
9
+ Project-URL: Repository, https://git.olog.io/olog/monobiome
10
+ Project-URL: Issues, https://git.olog.io/olog/monobiome/issues
11
+ Keywords: tempate-engine,color-palette
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: End Users/Desktop
17
+ Requires-Python: >=3.12
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: coloraide>=5.1
20
+ Requires-Dist: imageio[ffmpeg]>=2.37.2
21
+ Requires-Dist: kaleido>=1.1.0
22
+ Requires-Dist: matplotlib>=3.10.7
23
+ Requires-Dist: nbformat>=5.10.4
24
+ Requires-Dist: numpy>=2.3.4
25
+ Requires-Dist: pillow>=12.0.0
26
+ Requires-Dist: plotly>=6.3.1
27
+ Requires-Dist: pyqt5>=5.15.11
28
+ Requires-Dist: scipy>=1.16.2
29
+ Requires-Dist: symconf>=0.8.4
30
+ Provides-Extra: dev
31
+ Requires-Dist: ipykernel; extra == "dev"
32
+ Provides-Extra: doc
33
+ Requires-Dist: furo; extra == "doc"
34
+ Requires-Dist: myst-parser; extra == "doc"
35
+ Requires-Dist: sphinx; extra == "doc"
36
+ Requires-Dist: sphinx-togglebutton; extra == "doc"
37
+ Requires-Dist: sphinx-autodoc-typehints; extra == "doc"
38
+ Provides-Extra: test
39
+ Requires-Dist: pytest; extra == "test"
40
+
41
+ # Monobiome
42
+ `monobiome` is a minimal, balanced color palette for use in terminals and text
43
+ editors. It was designed in OKLCH space to achieve perceptual uniformity across
44
+ all hues at various levels of luminance, and does so for eight monotone bases
45
+ and eight accent colors (plus one zero chroma default base). Each of the
46
+ monotone base colors (named according to a natural biome whose colors they
47
+ loosely resemble) are designed to achieve identical contrast with the accents,
48
+ and thus any one of the options can be selected to change the feeling of
49
+ downstream themes without sacrificing readability.
50
+
51
+ ![Theme preview](images/repo_preview_primary.png)
52
+ _(Preview of light and dark alpine theme variants)_
53
+
54
+ The name "monobiome" connects the palette to its two key sources of
55
+ inspiration:
56
+
57
+ - `mono-`: `monobiome` is inspired by the [`monoindustrial` theme][1], and
58
+ attempts to extend and balance its accents while retaining similar color
59
+ identities.
60
+ - `-biome`: the desire for several distinct monotone options entailed finding a
61
+ way to ground the subtle color variations that were needed, and I liked the
62
+ idea of tying the choices to naturally occurring environmental variation like
63
+ Earth's biomes (even if it is a very loose affiliation, e.g., green-ish =
64
+ grass, basically).
65
+
66
+ ## Palette
67
+ The `monobiome` palette is fundamentally a set of parameterized curves in OKLCH
68
+ color space. Each color identity has one monotone curve and one accent curve,
69
+ both of which have fixed hue values and vary from 10% to 98% lightness.
70
+ Monotone curves have fixed chroma, whereas the accent curves' chroma varies
71
+ smoothly as a function of lightness within sRGB gamut bounds.
72
+
73
+ | Chroma curves | Color trajectories |
74
+ |----------------------------------------------------------|------------------------------------------|
75
+ | ![Chroma curves](images/release/1.5.1/chroma-curves.png) | ![Trajectories](images/trajectories.gif) |
76
+
77
+ | Palette |
78
+ |----------------------------------------------|
79
+ | ![Palette](images/release/1.5.1/palette.png) |
80
+
81
+ Chroma curves are designed specifically to establish a distinct role for each
82
+ accent and are non-intersecting over the lightness domain (hence the distinct
83
+ "bands" in the above chroma curve figure). There are eight monotone-accent
84
+ pairs, plus a single grey trajectory:
85
+
86
+ | Monotone / biome | Accent color | Hue |
87
+ | --- | --- | --- |
88
+ | alpine | grey | n/a |
89
+ | badlands | red | 29 |
90
+ | chaparral | orange | 62.5 |
91
+ | savanna | yellow | 104 |
92
+ | grassland | green | 148 |
93
+ | reef | cyan | 205 |
94
+ | tundra | blue | 262 |
95
+ | heathland | violet | 306 |
96
+ | moorland | magenta | 350 |
97
+
98
+ The `alpine`/`grey` curve has zero chroma (and is thus invariant to hue),
99
+ varying only in lightness from dark to light grey.
100
+
101
+ ## Themes
102
+
103
+ | Dark themes | Light themes |
104
+ |----------------------------------------|------------------------------------------|
105
+ | ![Dark themes](images/dark_themes.png) | ![Light themes](images/light_themes.png) |
106
+
107
+ Themes are derived from the `monobiome` palette by selecting a monotone base
108
+ (the "biome"), a base lightness, and a contrast level. Although one can use
109
+ arbitrary contrast metrics, OKLCH distance (Euclidean distance in OKLab)
110
+ is designed to capture perceptual distinction. As such, perceptually uniform
111
+ themes under arbitrary monotones can be generated by calculating the accent
112
+ colors equidistant from that base. This is equivalent to determining the points
113
+ at which a sphere centered at the monotone base intersects with the accent
114
+ curves; the radius of such a sphere effectively determines the theme contrast,
115
+ and the colors on the sphere surface are equally perceptually distinct relative
116
+ to the background.
117
+
118
+ The following plots show the intersection of the sphere centered at a fixed
119
+ background color (`alpine` biome with a lightness of 20) under variable radii:
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) |
125
+
126
+ In short, the base lightness (`-l`) dictates the brightness of the background,
127
+ and the contrast (`-d`) controls how perceptually distinct the accent colors
128
+ appear with respect to that background. These are free parameters of the
129
+ `monobiome` model: themes can be generated under arbitrary settings that meet
130
+ user preferences.
131
+
132
+ ## Generation
133
+ When generating full application themes, fixed lightness steps are used in the
134
+ chosen monotone trajectory to establish consistent levels of distinction
135
+ between background layers. For example, the following demonstrates how
136
+ background and foreground elements are chosen for the `monobiome` vim/neovim
137
+ themes:
138
+
139
+ ![
140
+ Diagram depicting how themes colors are selected by harshness and mapped onto
141
+ application-specific elements
142
+ ](images/vim_theme_elements.png)
143
+
144
+ Note how theme elements are mapped onto the general identifiers `bg0-bg3` for
145
+ backgrounds, `fg0-fg3` for foregrounds, and `gray` for a central gray tone. The
146
+ relative properties (lightness differences, contrast ratios) between colors
147
+ assigned to these identifiers are preserved regardless of biome or harshness
148
+ (e.g., `bg3` and `gray` are _always_ separated by 20 lightness points in any
149
+ theme). As a result, applying `monobiome` themes to specific applications can
150
+ effectively boil down to defining a single "relative template" that uses these
151
+ identifiers, after which any user-provided parameters can be applied
152
+ automatically.
153
+
154
+ The full palette $\rightarrow$ scheme $\rightarrow$ template $\rightarrow$
155
+ theme pipeline can be seen in detail below:
156
+
157
+ ![Generation pipeline](images/theme_generation_pipeline.png)
158
+
159
+ This figure demonstrates how `kitty` themes are generated, but the process is
160
+ generic to any palette, scheme, and app. This is implemented in two stages
161
+ using the `monobiome` CLI:
162
+
163
+ - First generate the scheme file, the lightness choices that achieve perceptual
164
+ uniformity of accents with respect to the base monotone:
165
+
166
+ ```sh
167
+ monobiome scheme dark grassland -d 0.42 -l 20 -o scheme.toml
168
+ ```
169
+
170
+ This calculates the accents a distance of `0.42` units in Oklab space from the
171
+ `grassland` monotone base at a lightness of `20`, and writes the output to
172
+ `scheme.toml`.
173
+ - Then populate the scheme file with concrete palette colors and push it
174
+ through an app config template:
175
+
176
+ ```sh
177
+ monobiome fill scheme.toml templates/kitty/active.theme -o kitty.theme
178
+ ```
179
+
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
+
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
+ ## Applications
190
+ This repo provides palette-agnostic theme templates for `kitty`,
191
+ `vim`/`neovim`, and `fzf` in the `templates/` directory. Pre-generated
192
+ *concrete* themes can be found in `app-config/`, if you'd like to try an
193
+ example out-of-the-box without using the `monobiome` CLI. Raw
194
+ palette colors can be found in `colors/` if you want to use them to define
195
+ static themes for other applications.
196
+
197
+ Themes files in the `app-config/` directory are generated for light and dark
198
+ modes of each biome, and named according to the following pattern:
199
+
200
+ ```sh
201
+ <biome>-monobiome-<mode>.<filename>
202
+ ```
203
+
204
+ One can set these themes for the provided applications as follows:
205
+
206
+ - `kitty`
207
+
208
+ Find `kitty` themes in `app-config/kitty`. Themes can be activated in your
209
+ `kitty.conf` with
210
+
211
+ ```sh
212
+ include <theme-file>
213
+ ```
214
+
215
+ Themes are generated using the [`kitty` theme
216
+ template](templates/kitty/active.theme).
217
+
218
+ - `vim`/`neovim`
219
+
220
+ Find `vim`/`neovim` themes in `app-config/nvim`. Themes can be activated by placing a
221
+ theme file on Vim's runtime path and setting it in your
222
+ `.vimrc`/`init.vim`/`init.lua`
223
+
224
+ with
225
+
226
+ ```sh
227
+ colorscheme <theme-name>
228
+ ```
229
+
230
+ Themes are generated using the [`vim` theme
231
+ template](templates/nvim/theme.vim).
232
+
233
+ - `fzf`
234
+
235
+ In `app-config/fzf`, you can find scripts that can be ran to export FZF theme
236
+ variables. In your shell config (e.g., `.bashrc` or `.zshrc`), you can source
237
+ these files to apply them in your terminal:
238
+
239
+ ```sh
240
+ source <theme-file>
241
+ ```
242
+
243
+ Themes are generated using the [`fzf` theme
244
+ template](templates/fzf/active.theme).
245
+
246
+ - Firefox
247
+
248
+ Firefox themes for all monotone backgrounds are publicly listed as [Mozilla
249
+ add-ons][2], and switch between light/dark schemes based on system settings.
250
+ You can also download raw XPI files for each theme in `app-config/firefox/`,
251
+ each of which is generated using the [Firefox `manifest.json`
252
+ template](templates/firefox/auto-manifest.json).
253
+
254
+ Static [light][4] and [dark][5] themes are additionally available (i.e., that
255
+ don't change with system settings).
256
+
257
+ ## CLI installation
258
+ A brief theme generation guide was provided in the [Generation
259
+ section](#generation), making use of the `monobiome` CLI. This tool can be
260
+ installed from PyPI, using `uv`/`pipx`/similar:
261
+
262
+ ```sh
263
+ uv tool install monobiome
264
+ # or
265
+ pipx install monobiome
266
+ ```
267
+
268
+ `monobiome` provides three subcommands:
269
+
270
+ - `monobiome palette`: generate palette files from raw parameterized curves
271
+
272
+ ```
273
+ usage: monobiome palette [-h] [-n {hex,oklch}] [-f {json,toml}] [-o OUTPUT]
274
+
275
+ options:
276
+ -n {hex,oklch}, --notation {hex,oklch}
277
+ color notation to export (either hex or oklch)
278
+ -f {json,toml}, --format {json,toml}
279
+ format of palette file (either JSON or TOML)
280
+ -o OUTPUT, --output OUTPUT
281
+ output file to write palette content
282
+ ```
283
+
284
+ - `monobiome scheme`: generate scheme files that match perceptual parameters
285
+
286
+ ```
287
+ usage: monobiome scheme [-h] [-m {wcag,oklch,lightness}] [-d DISTANCE] [-o OUTPUT] [-l L_BASE]
288
+ [--l-step L_STEP] [--fg-gap FG_GAP] [--grey-gap GREY_GAP]
289
+ [--term-fg-gap TERM_FG_GAP]
290
+ {dark,light}
291
+ {alpine,badlands,chaparral,savanna,grassland,reef,tundra,heathland,moorland}
292
+
293
+ positional arguments:
294
+ {dark,light} scheme mode (light or dark)
295
+ {alpine,badlands,chaparral,savanna,grassland,reef,tundra,heathland,moorland}
296
+ biome setting for scheme.
297
+
298
+ options:
299
+ -m {wcag,oklch,lightness}, --metric {wcag,oklch,lightness}
300
+ metric to use for measuring swatch distances.
301
+ -d DISTANCE, --distance DISTANCE
302
+ distance threshold for specified metric
303
+ -o OUTPUT, --output OUTPUT
304
+ output file to write scheme content
305
+ -l L_BASE, --l-base L_BASE
306
+ minimum lightness level (default: 20)
307
+ --l-step L_STEP lightness step size (default: 5)
308
+ --fg-gap FG_GAP foreground lightness gap (default: 50)
309
+ --grey-gap GREY_GAP grey lightness gap (default: 30)
310
+ --term-fg-gap TERM_FG_GAP
311
+ terminal foreground lightness gap (default: 60)
312
+ ```
313
+
314
+ - `monobiome fill`: produce concrete application themes from a given scheme and
315
+ app template
316
+
317
+ ```
318
+ usage: monobiome fill [-h] [-p PALETTE] [-o OUTPUT] scheme [template]
319
+
320
+ positional arguments:
321
+ scheme scheme file path
322
+ template template file path (defaults to stdin)
323
+
324
+ options:
325
+ -p PALETTE, --palette PALETTE
326
+ palette file to use for color definitions
327
+ -o OUTPUT, --output OUTPUT
328
+ output file to write filled template
329
+ ```
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
+
339
+
340
+ [1]: https://github.com/isa/TextMate-Themes/blob/master/monoindustrial.tmTheme
341
+ [2]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome/
342
+ [3]: https://github.com/ologio/symconf
343
+ [4]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome-light/
344
+ [5]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome-dark/
@@ -0,0 +1,304 @@
1
+ # Monobiome
2
+ `monobiome` is a minimal, balanced color palette for use in terminals and text
3
+ editors. It was designed in OKLCH space to achieve perceptual uniformity across
4
+ all hues at various levels of luminance, and does so for eight monotone bases
5
+ and eight accent colors (plus one zero chroma default base). Each of the
6
+ monotone base colors (named according to a natural biome whose colors they
7
+ loosely resemble) are designed to achieve identical contrast with the accents,
8
+ and thus any one of the options can be selected to change the feeling of
9
+ downstream themes without sacrificing readability.
10
+
11
+ ![Theme preview](images/repo_preview_primary.png)
12
+ _(Preview of light and dark alpine theme variants)_
13
+
14
+ The name "monobiome" connects the palette to its two key sources of
15
+ inspiration:
16
+
17
+ - `mono-`: `monobiome` is inspired by the [`monoindustrial` theme][1], and
18
+ attempts to extend and balance its accents while retaining similar color
19
+ identities.
20
+ - `-biome`: the desire for several distinct monotone options entailed finding a
21
+ way to ground the subtle color variations that were needed, and I liked the
22
+ idea of tying the choices to naturally occurring environmental variation like
23
+ Earth's biomes (even if it is a very loose affiliation, e.g., green-ish =
24
+ grass, basically).
25
+
26
+ ## Palette
27
+ The `monobiome` palette is fundamentally a set of parameterized curves in OKLCH
28
+ color space. Each color identity has one monotone curve and one accent curve,
29
+ both of which have fixed hue values and vary from 10% to 98% lightness.
30
+ Monotone curves have fixed chroma, whereas the accent curves' chroma varies
31
+ smoothly as a function of lightness within sRGB gamut bounds.
32
+
33
+ | Chroma curves | Color trajectories |
34
+ |----------------------------------------------------------|------------------------------------------|
35
+ | ![Chroma curves](images/release/1.5.1/chroma-curves.png) | ![Trajectories](images/trajectories.gif) |
36
+
37
+ | Palette |
38
+ |----------------------------------------------|
39
+ | ![Palette](images/release/1.5.1/palette.png) |
40
+
41
+ Chroma curves are designed specifically to establish a distinct role for each
42
+ accent and are non-intersecting over the lightness domain (hence the distinct
43
+ "bands" in the above chroma curve figure). There are eight monotone-accent
44
+ pairs, plus a single grey trajectory:
45
+
46
+ | Monotone / biome | Accent color | Hue |
47
+ | --- | --- | --- |
48
+ | alpine | grey | n/a |
49
+ | badlands | red | 29 |
50
+ | chaparral | orange | 62.5 |
51
+ | savanna | yellow | 104 |
52
+ | grassland | green | 148 |
53
+ | reef | cyan | 205 |
54
+ | tundra | blue | 262 |
55
+ | heathland | violet | 306 |
56
+ | moorland | magenta | 350 |
57
+
58
+ The `alpine`/`grey` curve has zero chroma (and is thus invariant to hue),
59
+ varying only in lightness from dark to light grey.
60
+
61
+ ## Themes
62
+
63
+ | Dark themes | Light themes |
64
+ |----------------------------------------|------------------------------------------|
65
+ | ![Dark themes](images/dark_themes.png) | ![Light themes](images/light_themes.png) |
66
+
67
+ Themes are derived from the `monobiome` palette by selecting a monotone base
68
+ (the "biome"), a base lightness, and a contrast level. Although one can use
69
+ arbitrary contrast metrics, OKLCH distance (Euclidean distance in OKLab)
70
+ is designed to capture perceptual distinction. As such, perceptually uniform
71
+ themes under arbitrary monotones can be generated by calculating the accent
72
+ colors equidistant from that base. This is equivalent to determining the points
73
+ at which a sphere centered at the monotone base intersects with the accent
74
+ curves; the radius of such a sphere effectively determines the theme contrast,
75
+ and the colors on the sphere surface are equally perceptually distinct relative
76
+ to the background.
77
+
78
+ The following plots show the intersection of the sphere centered at a fixed
79
+ background color (`alpine` biome with a lightness of 20) under variable radii:
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) |
85
+
86
+ In short, the base lightness (`-l`) dictates the brightness of the background,
87
+ and the contrast (`-d`) controls how perceptually distinct the accent colors
88
+ appear with respect to that background. These are free parameters of the
89
+ `monobiome` model: themes can be generated under arbitrary settings that meet
90
+ user preferences.
91
+
92
+ ## Generation
93
+ When generating full application themes, fixed lightness steps are used in the
94
+ chosen monotone trajectory to establish consistent levels of distinction
95
+ between background layers. For example, the following demonstrates how
96
+ background and foreground elements are chosen for the `monobiome` vim/neovim
97
+ themes:
98
+
99
+ ![
100
+ Diagram depicting how themes colors are selected by harshness and mapped onto
101
+ application-specific elements
102
+ ](images/vim_theme_elements.png)
103
+
104
+ Note how theme elements are mapped onto the general identifiers `bg0-bg3` for
105
+ backgrounds, `fg0-fg3` for foregrounds, and `gray` for a central gray tone. The
106
+ relative properties (lightness differences, contrast ratios) between colors
107
+ assigned to these identifiers are preserved regardless of biome or harshness
108
+ (e.g., `bg3` and `gray` are _always_ separated by 20 lightness points in any
109
+ theme). As a result, applying `monobiome` themes to specific applications can
110
+ effectively boil down to defining a single "relative template" that uses these
111
+ identifiers, after which any user-provided parameters can be applied
112
+ automatically.
113
+
114
+ The full palette $\rightarrow$ scheme $\rightarrow$ template $\rightarrow$
115
+ theme pipeline can be seen in detail below:
116
+
117
+ ![Generation pipeline](images/theme_generation_pipeline.png)
118
+
119
+ This figure demonstrates how `kitty` themes are generated, but the process is
120
+ generic to any palette, scheme, and app. This is implemented in two stages
121
+ using the `monobiome` CLI:
122
+
123
+ - First generate the scheme file, the lightness choices that achieve perceptual
124
+ uniformity of accents with respect to the base monotone:
125
+
126
+ ```sh
127
+ monobiome scheme dark grassland -d 0.42 -l 20 -o scheme.toml
128
+ ```
129
+
130
+ This calculates the accents a distance of `0.42` units in Oklab space from the
131
+ `grassland` monotone base at a lightness of `20`, and writes the output to
132
+ `scheme.toml`.
133
+ - Then populate the scheme file with concrete palette colors and push it
134
+ through an app config template:
135
+
136
+ ```sh
137
+ monobiome fill scheme.toml templates/kitty/active.theme -o kitty.theme
138
+ ```
139
+
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
+
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
+ ## Applications
150
+ This repo provides palette-agnostic theme templates for `kitty`,
151
+ `vim`/`neovim`, and `fzf` in the `templates/` directory. Pre-generated
152
+ *concrete* themes can be found in `app-config/`, if you'd like to try an
153
+ example out-of-the-box without using the `monobiome` CLI. Raw
154
+ palette colors can be found in `colors/` if you want to use them to define
155
+ static themes for other applications.
156
+
157
+ Themes files in the `app-config/` directory are generated for light and dark
158
+ modes of each biome, and named according to the following pattern:
159
+
160
+ ```sh
161
+ <biome>-monobiome-<mode>.<filename>
162
+ ```
163
+
164
+ One can set these themes for the provided applications as follows:
165
+
166
+ - `kitty`
167
+
168
+ Find `kitty` themes in `app-config/kitty`. Themes can be activated in your
169
+ `kitty.conf` with
170
+
171
+ ```sh
172
+ include <theme-file>
173
+ ```
174
+
175
+ Themes are generated using the [`kitty` theme
176
+ template](templates/kitty/active.theme).
177
+
178
+ - `vim`/`neovim`
179
+
180
+ Find `vim`/`neovim` themes in `app-config/nvim`. Themes can be activated by placing a
181
+ theme file on Vim's runtime path and setting it in your
182
+ `.vimrc`/`init.vim`/`init.lua`
183
+
184
+ with
185
+
186
+ ```sh
187
+ colorscheme <theme-name>
188
+ ```
189
+
190
+ Themes are generated using the [`vim` theme
191
+ template](templates/nvim/theme.vim).
192
+
193
+ - `fzf`
194
+
195
+ In `app-config/fzf`, you can find scripts that can be ran to export FZF theme
196
+ variables. In your shell config (e.g., `.bashrc` or `.zshrc`), you can source
197
+ these files to apply them in your terminal:
198
+
199
+ ```sh
200
+ source <theme-file>
201
+ ```
202
+
203
+ Themes are generated using the [`fzf` theme
204
+ template](templates/fzf/active.theme).
205
+
206
+ - Firefox
207
+
208
+ Firefox themes for all monotone backgrounds are publicly listed as [Mozilla
209
+ add-ons][2], and switch between light/dark schemes based on system settings.
210
+ You can also download raw XPI files for each theme in `app-config/firefox/`,
211
+ each of which is generated using the [Firefox `manifest.json`
212
+ template](templates/firefox/auto-manifest.json).
213
+
214
+ Static [light][4] and [dark][5] themes are additionally available (i.e., that
215
+ don't change with system settings).
216
+
217
+ ## CLI installation
218
+ A brief theme generation guide was provided in the [Generation
219
+ section](#generation), making use of the `monobiome` CLI. This tool can be
220
+ installed from PyPI, using `uv`/`pipx`/similar:
221
+
222
+ ```sh
223
+ uv tool install monobiome
224
+ # or
225
+ pipx install monobiome
226
+ ```
227
+
228
+ `monobiome` provides three subcommands:
229
+
230
+ - `monobiome palette`: generate palette files from raw parameterized curves
231
+
232
+ ```
233
+ usage: monobiome palette [-h] [-n {hex,oklch}] [-f {json,toml}] [-o OUTPUT]
234
+
235
+ options:
236
+ -n {hex,oklch}, --notation {hex,oklch}
237
+ color notation to export (either hex or oklch)
238
+ -f {json,toml}, --format {json,toml}
239
+ format of palette file (either JSON or TOML)
240
+ -o OUTPUT, --output OUTPUT
241
+ output file to write palette content
242
+ ```
243
+
244
+ - `monobiome scheme`: generate scheme files that match perceptual parameters
245
+
246
+ ```
247
+ usage: monobiome scheme [-h] [-m {wcag,oklch,lightness}] [-d DISTANCE] [-o OUTPUT] [-l L_BASE]
248
+ [--l-step L_STEP] [--fg-gap FG_GAP] [--grey-gap GREY_GAP]
249
+ [--term-fg-gap TERM_FG_GAP]
250
+ {dark,light}
251
+ {alpine,badlands,chaparral,savanna,grassland,reef,tundra,heathland,moorland}
252
+
253
+ positional arguments:
254
+ {dark,light} scheme mode (light or dark)
255
+ {alpine,badlands,chaparral,savanna,grassland,reef,tundra,heathland,moorland}
256
+ biome setting for scheme.
257
+
258
+ options:
259
+ -m {wcag,oklch,lightness}, --metric {wcag,oklch,lightness}
260
+ metric to use for measuring swatch distances.
261
+ -d DISTANCE, --distance DISTANCE
262
+ distance threshold for specified metric
263
+ -o OUTPUT, --output OUTPUT
264
+ output file to write scheme content
265
+ -l L_BASE, --l-base L_BASE
266
+ minimum lightness level (default: 20)
267
+ --l-step L_STEP lightness step size (default: 5)
268
+ --fg-gap FG_GAP foreground lightness gap (default: 50)
269
+ --grey-gap GREY_GAP grey lightness gap (default: 30)
270
+ --term-fg-gap TERM_FG_GAP
271
+ terminal foreground lightness gap (default: 60)
272
+ ```
273
+
274
+ - `monobiome fill`: produce concrete application themes from a given scheme and
275
+ app template
276
+
277
+ ```
278
+ usage: monobiome fill [-h] [-p PALETTE] [-o OUTPUT] scheme [template]
279
+
280
+ positional arguments:
281
+ scheme scheme file path
282
+ template template file path (defaults to stdin)
283
+
284
+ options:
285
+ -p PALETTE, --palette PALETTE
286
+ palette file to use for color definitions
287
+ -o OUTPUT, --output OUTPUT
288
+ output file to write filled template
289
+ ```
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
+
299
+
300
+ [1]: https://github.com/isa/TextMate-Themes/blob/master/monoindustrial.tmTheme
301
+ [2]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome/
302
+ [3]: https://github.com/ologio/symconf
303
+ [4]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome-light/
304
+ [5]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome-dark/
@@ -10,7 +10,7 @@ def main() -> None:
10
10
  configure_logging(args.log_level)
11
11
 
12
12
  if "func" in args:
13
- args.func(args)
13
+ args.func(args, parser)
14
14
  else:
15
15
  parser.print_help()
16
16
 
@@ -1,7 +1,7 @@
1
1
  import logging
2
- import argparse
2
+ from argparse import ArgumentParser
3
3
 
4
- from monobiome.cli import scheme, palette
4
+ from monobiome.cli import fill, scheme, palette
5
5
 
6
6
  logger: logging.Logger = logging.getLogger(__name__)
7
7
 
@@ -12,8 +12,8 @@ def configure_logging(log_level: int) -> None:
12
12
 
13
13
  logger.setLevel(log_level)
14
14
 
15
- def create_parser() -> argparse.ArgumentParser:
16
- parser = argparse.ArgumentParser(
15
+ def create_parser() -> ArgumentParser:
16
+ parser = ArgumentParser(
17
17
  description="Accent modeling CLI",
18
18
  )
19
19
  parser.add_argument(
@@ -26,7 +26,8 @@ def create_parser() -> argparse.ArgumentParser:
26
26
 
27
27
  subparsers = parser.add_subparsers(help="subcommand help")
28
28
 
29
- palette.register_parser(subparsers)
29
+ fill.register_parser(subparsers)
30
30
  scheme.register_parser(subparsers)
31
+ palette.register_parser(subparsers)
31
32
 
32
33
  return parser