monobiome 1.3.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.
@@ -0,0 +1,231 @@
1
+ Metadata-Version: 2.4
2
+ Name: monobiome
3
+ Version: 1.3.1
4
+ Summary: Monobiome color palette
5
+ Project-URL: Homepage, https://doc.olog.io/monobiome
6
+ Project-URL: Documentation, https://doc.olog.io/monobiome
7
+ Project-URL: Repository, https://git.olog.io/olog/monobiome
8
+ Project-URL: Issues, https://git.olog.io/olog/monobiome/issues
9
+ Requires-Python: >=3.12
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: coloraide>=5.1
12
+ Requires-Dist: imageio[ffmpeg]>=2.37.2
13
+ Requires-Dist: ipython>=9.6.0
14
+ Requires-Dist: kaleido>=1.1.0
15
+ Requires-Dist: matplotlib>=3.10.7
16
+ Requires-Dist: nbformat>=5.10.4
17
+ Requires-Dist: numpy>=2.3.4
18
+ Requires-Dist: pillow>=12.0.0
19
+ Requires-Dist: plotly>=6.3.1
20
+ Requires-Dist: scipy>=1.16.2
21
+
22
+ # Monobiome
23
+ `monobiome` is a minimal, balanced color palette for use in terminals and text
24
+ editors. It was designed in OKLCH space to achieve perceptual uniformity across
25
+ all hues at various levels of luminance, and does so for _five_ monotone bases
26
+ and _five_ accent colors (plus one gray "default"). Each of the monotone base
27
+ colors (named according to a natural biome whose colors they loosely resemble)
28
+ are designed to achieve identical contrast with the accents, and thus any one
29
+ of the options can be selected to change the feeling of the palette without
30
+ sacrificing readability.
31
+
32
+ ![Theme preview](images/repo_preview_four_split.png)
33
+ _(Preview of default light and dark theme variants)_
34
+
35
+ See screenshots for the full set of theme variants in [THEMES](THEMES.md) (also
36
+ discussed below).
37
+
38
+ The name "monobiome" connects the palette to its two key sources of
39
+ inspiration:
40
+
41
+ - `mono-`: `monobiome` is inspired by the [`monoindustrial` theme][1], and
42
+ attempts to extend and balance its accents while retaining similar color
43
+ identities.
44
+ - `-biome`: the desire for several distinct monotone options entailed finding a
45
+ way to ground the subtle color variations that were needed, and I liked the
46
+ idea of tying the choices to naturally occurring environmental variation like
47
+ Earth's biomes (even if it is a very loose affiliation, e.g., green-ish =
48
+ grass, basically).
49
+
50
+ ## Palette
51
+ The `monobiome` palette consists of four monotone bases and five accent colors,
52
+ each of which is anchored by hue and spread uniformly across lightness levels
53
+ 15 to 95 (in OKLCH space).
54
+
55
+ ![Diagram of palette accents and monotones](images/palette.png)
56
+
57
+ The chroma curve for each accent is carefully designed to vary smoothly across
58
+ the lightness spectrum, with the goal of retaining strong color identity in all
59
+ settings. Additionally, as alluded to above, the (WCAG 2) contrast ratio
60
+ between any choice of monotone background at a given lightness level and the
61
+ accent colors is virtually identical ($\pm 0.1$). Put another way, the relative
62
+ contrast between accents depends only on the _lightness_ of the background
63
+ monotone, not its hue. *(Note that this is not generally the case; at a fixed
64
+ lightness level, the contrast between two colors depends on their hue.)*
65
+
66
+ ## Concrete themes
67
+
68
+ ![Split view of Alpine and Tundra biomes](images/theme-split-view.png)
69
+
70
+ *(Light and dark theme splits of Alpine and Tundra biomes)*
71
+
72
+ Themes are derived from the `monobiome` palette by varying both the monotone
73
+ hue (the "biome") and the extent of the background/foreground lightness (the
74
+ "harshness"). This is done for both light and dark schemes, and in each case
75
+ accent colors are selected at a lightness level that ensures each meet a
76
+ minimum contrast relative to the primary background. The following diagram
77
+ shows each of the 36 resulting combinations:
78
+
79
+ ![Diagram of the 36 available concrete theme options](images/themes.png)
80
+
81
+ The "soft" harshness level uses monotone shades closer to the mid-shade
82
+ (lightness level 55), whereas "hard" harshness uses shades further from it.
83
+ Once the biome and harshness level are chosen, we're left with a bounded
84
+ monotone range over which common theme elements can be defined. For example,
85
+ the following demonstrates how background and foreground elements are chosen
86
+ for the `monobiome` Vim themes:
87
+
88
+ ![
89
+ Diagram depicting how themes colors are selected by harshness and mapped onto
90
+ application-specific elements
91
+ ](images/vim_theme_elements.png)
92
+
93
+ Note how theme elements are mapped onto the general identifiers `bg0-bg3` for
94
+ backgrounds, `fg0-fg3` for foregrounds, and `gray` for a central gray tone. The
95
+ relative properties (lightness differences, contrast ratios) between colors
96
+ assigned to these identifiers are preserved regardless of biome or harshness
97
+ (e.g., `bg3` and `gray` are _always_ separated by 20 lightness points in any
98
+ theme). As a result, applying `monobiome` themes to specific applications can
99
+ effectively boil down to defining a single "relative template" that uses these
100
+ identifiers, after which any of the 36 theme options can applied immediately.
101
+
102
+ Read more about how themes are created in [DESIGN](DESIGN.md).
103
+
104
+ # Usage
105
+ This repo provides the 36 theme files for `kitty`, `vim`/`neovim`, and `fzf` in
106
+ the `app-config/` directory. You can also find raw palette colors in
107
+ `colors/monobiome.toml` if you want to use them to define themes for other
108
+ applications.
109
+
110
+ Each of the files in the `app-config/` directory are named according to
111
+
112
+ ```sh
113
+ <harshness>-<biome>-monobiome-<mode>.<ext>
114
+ ```
115
+
116
+ For example, `monobiome-tundra-dark-soft.vim` is the Vim theme file for the
117
+ dark `tundra` variant with the soft harshness level.
118
+
119
+ ## Applications
120
+ - `kitty`
121
+
122
+ Find `kitty` themes in `app-config/kitty`. Themes can be activated in your
123
+ `kitty.conf` with
124
+
125
+ ```sh
126
+ include <theme-file>
127
+ ```
128
+
129
+ Themes are generated using the [`kitty` theme
130
+ template](templates/apps/kitty/templates/active.theme).
131
+
132
+ - `vim`/`neovim`
133
+
134
+ Find `vim`/`neovim` themes in `app-config/nvim`. Themes can be activated by placing a
135
+ theme file on Vim's runtime path and setting it in your `.vimrc`/`init.vim`
136
+ with
137
+
138
+ ```sh
139
+ colorscheme <theme-name>
140
+ ```
141
+
142
+ Themes are generated using the [`vim` theme
143
+ template](templates/apps/nvim/templates/theme.vim).
144
+
145
+ - `fzf`
146
+
147
+ In `app-config/fzf`, you can find scripts that can be ran to export FZF theme
148
+ variables. In your shell config (e.g., `.bashrc` or `.zshrc`), you can source
149
+ these files to apply them in your terminal:
150
+
151
+ ```sh
152
+ source <theme-file>
153
+ ```
154
+
155
+ Themes are generated using the [`fzf` theme
156
+ template](templates/apps/fzf/templates/active.theme).
157
+
158
+ - Firefox
159
+
160
+ Firefox themes for all monotone backgrounds are publicly listed as [Mozilla
161
+ add-ons][2], and switch between light/dark schemes based on system settings.
162
+ You can also download raw XPI files for each theme in `app-config/firefox/`,
163
+ each of which is generated using the [Firefox `manifest.json`
164
+ template](templates/apps/firefox/templates/none-dark.manifest.json).
165
+
166
+ Static [light][4] and [dark][5] are additionally available.
167
+
168
+ ![Firefox theme previews](images/firefox/themes.png)
169
+
170
+ # Switching themes
171
+ [`symconf`][3] is a general-purpose application config manager that can be used
172
+ to generate all `monobiome` variants from a single palette file, and set themes
173
+ for all apps at once. You can find example theme templates in
174
+ `templates/groups/theme`, which provide general theme variables you can use in
175
+ your own config templates.
176
+
177
+ For instance, in an app like `kitty`, you can define a template like
178
+
179
+ ```conf
180
+ # base settings
181
+ background f{{theme.term.background}}
182
+ foreground f{{theme.term.foreground}}
183
+
184
+ selection_background f{{theme.term.selection_bg}}
185
+ selection_foreground f{{theme.term.selection_fg}}
186
+
187
+ cursor f{{theme.term.cursor}}
188
+ cursor_text_color f{{theme.term.cursor_text_color}}
189
+
190
+ # black
191
+ color0 f{{theme.term.normal.black}}
192
+ color8 f{{theme.term.bright.black}}
193
+
194
+ # red
195
+ color1 f{{theme.term.normal.red}}
196
+ color9 f{{theme.term.bright.red}}
197
+
198
+ # green
199
+ color2 f{{theme.term.normal.green}}
200
+ color10 f{{theme.term.bright.green}}
201
+
202
+ # yellow
203
+ color3 f{{theme.term.normal.yellow}}
204
+ color11 f{{theme.term.bright.yellow}}
205
+
206
+ # blue
207
+ color4 f{{theme.term.normal.blue}}
208
+ color12 f{{theme.term.bright.blue}}
209
+
210
+ # purple (red)
211
+ color5 f{{theme.term.normal.purple}}
212
+ color13 f{{theme.term.bright.purple}}
213
+
214
+ # cyan (blue)
215
+ color6 f{{theme.term.normal.cyan}}
216
+ color14 f{{theme.term.bright.cyan}}
217
+
218
+ ## white
219
+ color7 f{{theme.term.normal.white}}
220
+ color15 f{{theme.term.bright.white}}
221
+ ```
222
+
223
+ and use `symconf` to dynamically fill these variables based on a selected
224
+ biome/harshness/mode. This can be done for any app config file.
225
+
226
+
227
+ [1]: https://github.com/isa/TextMate-Themes/blob/master/monoindustrial.tmTheme
228
+ [2]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome/
229
+ [3]: https://github.com/ologio/symconf
230
+ [4]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome-light/
231
+ [5]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome-dark/
@@ -0,0 +1,210 @@
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 _five_ monotone bases
5
+ and _five_ accent colors (plus one gray "default"). Each of the monotone base
6
+ colors (named according to a natural biome whose colors they loosely resemble)
7
+ are designed to achieve identical contrast with the accents, and thus any one
8
+ of the options can be selected to change the feeling of the palette without
9
+ sacrificing readability.
10
+
11
+ ![Theme preview](images/repo_preview_four_split.png)
12
+ _(Preview of default light and dark theme variants)_
13
+
14
+ See screenshots for the full set of theme variants in [THEMES](THEMES.md) (also
15
+ discussed below).
16
+
17
+ The name "monobiome" connects the palette to its two key sources of
18
+ inspiration:
19
+
20
+ - `mono-`: `monobiome` is inspired by the [`monoindustrial` theme][1], and
21
+ attempts to extend and balance its accents while retaining similar color
22
+ identities.
23
+ - `-biome`: the desire for several distinct monotone options entailed finding a
24
+ way to ground the subtle color variations that were needed, and I liked the
25
+ idea of tying the choices to naturally occurring environmental variation like
26
+ Earth's biomes (even if it is a very loose affiliation, e.g., green-ish =
27
+ grass, basically).
28
+
29
+ ## Palette
30
+ The `monobiome` palette consists of four monotone bases and five accent colors,
31
+ each of which is anchored by hue and spread uniformly across lightness levels
32
+ 15 to 95 (in OKLCH space).
33
+
34
+ ![Diagram of palette accents and monotones](images/palette.png)
35
+
36
+ The chroma curve for each accent is carefully designed to vary smoothly across
37
+ the lightness spectrum, with the goal of retaining strong color identity in all
38
+ settings. Additionally, as alluded to above, the (WCAG 2) contrast ratio
39
+ between any choice of monotone background at a given lightness level and the
40
+ accent colors is virtually identical ($\pm 0.1$). Put another way, the relative
41
+ contrast between accents depends only on the _lightness_ of the background
42
+ monotone, not its hue. *(Note that this is not generally the case; at a fixed
43
+ lightness level, the contrast between two colors depends on their hue.)*
44
+
45
+ ## Concrete themes
46
+
47
+ ![Split view of Alpine and Tundra biomes](images/theme-split-view.png)
48
+
49
+ *(Light and dark theme splits of Alpine and Tundra biomes)*
50
+
51
+ Themes are derived from the `monobiome` palette by varying both the monotone
52
+ hue (the "biome") and the extent of the background/foreground lightness (the
53
+ "harshness"). This is done for both light and dark schemes, and in each case
54
+ accent colors are selected at a lightness level that ensures each meet a
55
+ minimum contrast relative to the primary background. The following diagram
56
+ shows each of the 36 resulting combinations:
57
+
58
+ ![Diagram of the 36 available concrete theme options](images/themes.png)
59
+
60
+ The "soft" harshness level uses monotone shades closer to the mid-shade
61
+ (lightness level 55), whereas "hard" harshness uses shades further from it.
62
+ Once the biome and harshness level are chosen, we're left with a bounded
63
+ monotone range over which common theme elements can be defined. For example,
64
+ the following demonstrates how background and foreground elements are chosen
65
+ for the `monobiome` Vim themes:
66
+
67
+ ![
68
+ Diagram depicting how themes colors are selected by harshness and mapped onto
69
+ application-specific elements
70
+ ](images/vim_theme_elements.png)
71
+
72
+ Note how theme elements are mapped onto the general identifiers `bg0-bg3` for
73
+ backgrounds, `fg0-fg3` for foregrounds, and `gray` for a central gray tone. The
74
+ relative properties (lightness differences, contrast ratios) between colors
75
+ assigned to these identifiers are preserved regardless of biome or harshness
76
+ (e.g., `bg3` and `gray` are _always_ separated by 20 lightness points in any
77
+ theme). As a result, applying `monobiome` themes to specific applications can
78
+ effectively boil down to defining a single "relative template" that uses these
79
+ identifiers, after which any of the 36 theme options can applied immediately.
80
+
81
+ Read more about how themes are created in [DESIGN](DESIGN.md).
82
+
83
+ # Usage
84
+ This repo provides the 36 theme files for `kitty`, `vim`/`neovim`, and `fzf` in
85
+ the `app-config/` directory. You can also find raw palette colors in
86
+ `colors/monobiome.toml` if you want to use them to define themes for other
87
+ applications.
88
+
89
+ Each of the files in the `app-config/` directory are named according to
90
+
91
+ ```sh
92
+ <harshness>-<biome>-monobiome-<mode>.<ext>
93
+ ```
94
+
95
+ For example, `monobiome-tundra-dark-soft.vim` is the Vim theme file for the
96
+ dark `tundra` variant with the soft harshness level.
97
+
98
+ ## Applications
99
+ - `kitty`
100
+
101
+ Find `kitty` themes in `app-config/kitty`. Themes can be activated in your
102
+ `kitty.conf` with
103
+
104
+ ```sh
105
+ include <theme-file>
106
+ ```
107
+
108
+ Themes are generated using the [`kitty` theme
109
+ template](templates/apps/kitty/templates/active.theme).
110
+
111
+ - `vim`/`neovim`
112
+
113
+ Find `vim`/`neovim` themes in `app-config/nvim`. Themes can be activated by placing a
114
+ theme file on Vim's runtime path and setting it in your `.vimrc`/`init.vim`
115
+ with
116
+
117
+ ```sh
118
+ colorscheme <theme-name>
119
+ ```
120
+
121
+ Themes are generated using the [`vim` theme
122
+ template](templates/apps/nvim/templates/theme.vim).
123
+
124
+ - `fzf`
125
+
126
+ In `app-config/fzf`, you can find scripts that can be ran to export FZF theme
127
+ variables. In your shell config (e.g., `.bashrc` or `.zshrc`), you can source
128
+ these files to apply them in your terminal:
129
+
130
+ ```sh
131
+ source <theme-file>
132
+ ```
133
+
134
+ Themes are generated using the [`fzf` theme
135
+ template](templates/apps/fzf/templates/active.theme).
136
+
137
+ - Firefox
138
+
139
+ Firefox themes for all monotone backgrounds are publicly listed as [Mozilla
140
+ add-ons][2], and switch between light/dark schemes based on system settings.
141
+ You can also download raw XPI files for each theme in `app-config/firefox/`,
142
+ each of which is generated using the [Firefox `manifest.json`
143
+ template](templates/apps/firefox/templates/none-dark.manifest.json).
144
+
145
+ Static [light][4] and [dark][5] are additionally available.
146
+
147
+ ![Firefox theme previews](images/firefox/themes.png)
148
+
149
+ # Switching themes
150
+ [`symconf`][3] is a general-purpose application config manager that can be used
151
+ to generate all `monobiome` variants from a single palette file, and set themes
152
+ for all apps at once. You can find example theme templates in
153
+ `templates/groups/theme`, which provide general theme variables you can use in
154
+ your own config templates.
155
+
156
+ For instance, in an app like `kitty`, you can define a template like
157
+
158
+ ```conf
159
+ # base settings
160
+ background f{{theme.term.background}}
161
+ foreground f{{theme.term.foreground}}
162
+
163
+ selection_background f{{theme.term.selection_bg}}
164
+ selection_foreground f{{theme.term.selection_fg}}
165
+
166
+ cursor f{{theme.term.cursor}}
167
+ cursor_text_color f{{theme.term.cursor_text_color}}
168
+
169
+ # black
170
+ color0 f{{theme.term.normal.black}}
171
+ color8 f{{theme.term.bright.black}}
172
+
173
+ # red
174
+ color1 f{{theme.term.normal.red}}
175
+ color9 f{{theme.term.bright.red}}
176
+
177
+ # green
178
+ color2 f{{theme.term.normal.green}}
179
+ color10 f{{theme.term.bright.green}}
180
+
181
+ # yellow
182
+ color3 f{{theme.term.normal.yellow}}
183
+ color11 f{{theme.term.bright.yellow}}
184
+
185
+ # blue
186
+ color4 f{{theme.term.normal.blue}}
187
+ color12 f{{theme.term.bright.blue}}
188
+
189
+ # purple (red)
190
+ color5 f{{theme.term.normal.purple}}
191
+ color13 f{{theme.term.bright.purple}}
192
+
193
+ # cyan (blue)
194
+ color6 f{{theme.term.normal.cyan}}
195
+ color14 f{{theme.term.bright.cyan}}
196
+
197
+ ## white
198
+ color7 f{{theme.term.normal.white}}
199
+ color15 f{{theme.term.bright.white}}
200
+ ```
201
+
202
+ and use `symconf` to dynamically fill these variables based on a selected
203
+ biome/harshness/mode. This can be done for any app config file.
204
+
205
+
206
+ [1]: https://github.com/isa/TextMate-Themes/blob/master/monoindustrial.tmTheme
207
+ [2]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome/
208
+ [3]: https://github.com/ologio/symconf
209
+ [4]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome-light/
210
+ [5]: https://addons.mozilla.org/en-US/firefox/collections/18495484/monobiome-dark/
@@ -0,0 +1,3 @@
1
+ from importlib.metadata import version
2
+
3
+ __version__ = version("monobiome")
@@ -0,0 +1,19 @@
1
+ from monobiome.cli import create_parser, configure_logging
2
+
3
+
4
+ def main() -> None:
5
+ parser = create_parser()
6
+ args = parser.parse_args()
7
+
8
+ # skim off log level to handle higher-level option
9
+ if hasattr(args, "log_level") and args.log_level is not None:
10
+ configure_logging(args.log_level)
11
+
12
+ if "func" in args:
13
+ args.func(args)
14
+ else:
15
+ parser.print_help()
16
+
17
+
18
+ if __name__ == "__main__":
19
+ main()
@@ -0,0 +1,32 @@
1
+ import logging
2
+ import argparse
3
+
4
+ from monobiome.cli import scheme, palette
5
+
6
+ logger: logging.Logger = logging.getLogger(__name__)
7
+
8
+ def configure_logging(log_level: int) -> None:
9
+ """
10
+ Configure logger's logging level.
11
+ """
12
+
13
+ logger.setLevel(log_level)
14
+
15
+ def create_parser() -> argparse.ArgumentParser:
16
+ parser = argparse.ArgumentParser(
17
+ description="Accent modeling CLI",
18
+ )
19
+ parser.add_argument(
20
+ "--log-level",
21
+ type=int,
22
+ metavar="int",
23
+ choices=[10, 20, 30, 40, 50],
24
+ help="Log level: 10=DEBUG, 20=INFO, 30=WARNING, 40=ERROR, 50=CRITICAL",
25
+ )
26
+
27
+ subparsers = parser.add_subparsers(help="subcommand help")
28
+
29
+ palette.register_parser(subparsers)
30
+ scheme.register_parser(subparsers)
31
+
32
+ return parser
@@ -0,0 +1,51 @@
1
+ import argparse
2
+ from pathlib import Path
3
+
4
+ from monobiome.util import _SubparserType
5
+ from monobiome.palette import generate_palette
6
+
7
+
8
+ def register_parser(subparsers: _SubparserType) -> None:
9
+ parser = subparsers.add_parser(
10
+ "palette",
11
+ help="generate primary palette"
12
+ )
13
+
14
+ parser.add_argument(
15
+ "-n",
16
+ "--notation",
17
+ type=str,
18
+ default="hex",
19
+ choices=["hex", "oklch"],
20
+ help="Color notation to export (either hex or oklch)",
21
+ )
22
+ parser.add_argument(
23
+ "-f",
24
+ "--format",
25
+ type=str,
26
+ default="toml",
27
+ choices=["json", "toml"],
28
+ help="Format of palette file (either JSON or TOML)",
29
+ )
30
+ parser.add_argument(
31
+ "-o",
32
+ "--output",
33
+ type=str,
34
+ help="Output file to write palette content",
35
+ )
36
+
37
+ parser.set_defaults(func=handle_palette)
38
+
39
+
40
+ def handle_palette(args: argparse.Namespace) -> None:
41
+ notation = args.notation
42
+ file_format = args.format
43
+ output = args.output
44
+
45
+ palette_text = generate_palette(notation, file_format)
46
+
47
+ if output is None:
48
+ print(palette_text)
49
+ else:
50
+ with Path(output).open("w") as f:
51
+ f.write(palette_text)