diff --git a/.gitignore b/.gitignore index 191c43e..71958ad 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ archive/ notebooks/color_spaces_manyview.ipynb notebooks/oklch_srgb_spherical.ipynb +notebooks/v1.4.0/ diff --git a/app-config/firefox/alpine-monobiome-dark.xpi b/app-config/firefox/alpine-monobiome-dark.xpi index 28f2857..9c75658 100644 Binary files a/app-config/firefox/alpine-monobiome-dark.xpi and b/app-config/firefox/alpine-monobiome-dark.xpi differ diff --git a/app-config/firefox/alpine-monobiome-light.xpi b/app-config/firefox/alpine-monobiome-light.xpi index 22c8ab4..5805ed4 100644 Binary files a/app-config/firefox/alpine-monobiome-light.xpi and b/app-config/firefox/alpine-monobiome-light.xpi differ diff --git a/app-config/firefox/alpine-monobiome.xpi b/app-config/firefox/alpine-monobiome.xpi index 3165196..bcbcabb 100644 Binary files a/app-config/firefox/alpine-monobiome.xpi and b/app-config/firefox/alpine-monobiome.xpi differ diff --git a/app-config/firefox/badlands-monobiome-dark.xpi b/app-config/firefox/badlands-monobiome-dark.xpi index a3b4b00..77b0482 100644 Binary files a/app-config/firefox/badlands-monobiome-dark.xpi and b/app-config/firefox/badlands-monobiome-dark.xpi differ diff --git a/app-config/firefox/badlands-monobiome-light.xpi b/app-config/firefox/badlands-monobiome-light.xpi index 40d02fa..64210b8 100644 Binary files a/app-config/firefox/badlands-monobiome-light.xpi and b/app-config/firefox/badlands-monobiome-light.xpi differ diff --git a/app-config/firefox/badlands-monobiome.xpi b/app-config/firefox/badlands-monobiome.xpi index 0df8325..711675e 100644 Binary files a/app-config/firefox/badlands-monobiome.xpi and b/app-config/firefox/badlands-monobiome.xpi differ diff --git a/app-config/firefox/chaparral-monobiome-dark.xpi b/app-config/firefox/chaparral-monobiome-dark.xpi index ea3be7a..a36bb21 100644 Binary files a/app-config/firefox/chaparral-monobiome-dark.xpi and b/app-config/firefox/chaparral-monobiome-dark.xpi differ diff --git a/app-config/firefox/chaparral-monobiome-light.xpi b/app-config/firefox/chaparral-monobiome-light.xpi index eae110e..25ecae0 100644 Binary files a/app-config/firefox/chaparral-monobiome-light.xpi and b/app-config/firefox/chaparral-monobiome-light.xpi differ diff --git a/app-config/firefox/chaparral-monobiome.xpi b/app-config/firefox/chaparral-monobiome.xpi index df93b29..f3bcb9a 100644 Binary files a/app-config/firefox/chaparral-monobiome.xpi and b/app-config/firefox/chaparral-monobiome.xpi differ diff --git a/app-config/firefox/grassland-monobiome-dark.xpi b/app-config/firefox/grassland-monobiome-dark.xpi index cd6353f..540eda7 100644 Binary files a/app-config/firefox/grassland-monobiome-dark.xpi and b/app-config/firefox/grassland-monobiome-dark.xpi differ diff --git a/app-config/firefox/grassland-monobiome-light.xpi b/app-config/firefox/grassland-monobiome-light.xpi index dd302cb..3f871a4 100644 Binary files a/app-config/firefox/grassland-monobiome-light.xpi and b/app-config/firefox/grassland-monobiome-light.xpi differ diff --git a/app-config/firefox/grassland-monobiome.xpi b/app-config/firefox/grassland-monobiome.xpi index 4baa330..d9ad826 100644 Binary files a/app-config/firefox/grassland-monobiome.xpi and b/app-config/firefox/grassland-monobiome.xpi differ diff --git a/app-config/firefox/savanna-monobiome-dark.xpi b/app-config/firefox/savanna-monobiome-dark.xpi index a2deec8..cde01e3 100644 Binary files a/app-config/firefox/savanna-monobiome-dark.xpi and b/app-config/firefox/savanna-monobiome-dark.xpi differ diff --git a/app-config/firefox/savanna-monobiome-light.xpi b/app-config/firefox/savanna-monobiome-light.xpi index 2493528..a073cf5 100644 Binary files a/app-config/firefox/savanna-monobiome-light.xpi and b/app-config/firefox/savanna-monobiome-light.xpi differ diff --git a/app-config/firefox/savanna-monobiome.xpi b/app-config/firefox/savanna-monobiome.xpi index e570769..4d52034 100644 Binary files a/app-config/firefox/savanna-monobiome.xpi and b/app-config/firefox/savanna-monobiome.xpi differ diff --git a/app-config/firefox/tundra-monobiome-dark.xpi b/app-config/firefox/tundra-monobiome-dark.xpi index 623399f..fe12850 100644 Binary files a/app-config/firefox/tundra-monobiome-dark.xpi and b/app-config/firefox/tundra-monobiome-dark.xpi differ diff --git a/app-config/firefox/tundra-monobiome-light.xpi b/app-config/firefox/tundra-monobiome-light.xpi index f087016..9c04a8f 100644 Binary files a/app-config/firefox/tundra-monobiome-light.xpi and b/app-config/firefox/tundra-monobiome-light.xpi differ diff --git a/app-config/firefox/tundra-monobiome.xpi b/app-config/firefox/tundra-monobiome.xpi index c5827a6..84eb18f 100644 Binary files a/app-config/firefox/tundra-monobiome.xpi and b/app-config/firefox/tundra-monobiome.xpi differ diff --git a/images/color_stats/chroma-curves-v130.png b/images/color_stats/chroma-curves-v130.png new file mode 100644 index 0000000..5936131 Binary files /dev/null and b/images/color_stats/chroma-curves-v130.png differ diff --git a/monobiome/constants.py b/monobiome/constants.py new file mode 100644 index 0000000..b034c8f --- /dev/null +++ b/monobiome/constants.py @@ -0,0 +1,157 @@ +import numpy as np + +# SET LIGHTNESS CONTROL POINTS +# L_points = [10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 98] +L_points = list(range(10, 98+1)) + +# FIXED MONOBIOME PARAMETERS +L_resolution = 5 # step size along lightness dim +L_space = np.arange(0, 100+L_resolution, L_resolution) + +monotone_C_map = { + "alpine": 0, + "badlands": 0.011, + "chaparral": 0.011, + "savanna": 0.011, + "grassland": 0.011, + "tundra": 0.011, +} + +h_weights = { + "red": 3.0, + "orange": 3.8, # 3.6 + "yellow": 3.8, # 4.0 + "green": 3.8, + "blue": 3.4, # 3.8 +} +h_L_offsets = { + "red": 0, # -1, + "orange": -5.5, # -3, + "yellow": -13.5, # -8 + "green": -11, # -8 + "blue": 10, # 14 +} +h_C_offsets = { + "red": 0, # 0 + "orange": -0.01, # -0.02 + "yellow": -0.052, # -0.08 + "green": -0.088, # -0.105 + "blue": 0.0, # 0.01 +} + +monotone_h_map = { + "alpine": 0, + "badlands": 29, + "chaparral": 62.5, + "savanna": 104, + "grassland": 148, + "tundra": 262, +} +accent_h_map = { + "red": 29, + "orange": 62.5, + "yellow": 104, + "green": 148, + "blue": 262, +} +h_map = {**monotone_h_map, **accent_h_map} + + +v111_L_space = list(range(15, 95+1, 5)) +v111_hC_points = { + "red": [ + 0.058, + 0.074, + 0.092, + 0.11, + 0.128, + 0.147, + 0.167, + 0.183, + 0.193, + 0.193, + 0.182, + 0.164, + 0.14, + 0.112, + 0.081, + 0.052, + 0.024, + ], + "orange": [ + 0.030, + 0.038, + 0.046, + 0.058, + 0.07, + 0.084, + 0.1, + 0.114, + 0.125, + 0.134, + 0.138, + 0.136, + 0.128, + 0.112, + 0.092, + 0.064, + 0.032, + ], + "yellow": [ + 0.02, + 0.024, + 0.03, + 0.036, + 0.044, + 0.05, + 0.06, + 0.068, + 0.076, + 0.082, + 0.088, + 0.088, + 0.086, + 0.082, + 0.072, + 0.058, + 0.04, + ], + "green": [ + 0.0401, + 0.048, + 0.056, + 0.064, + 0.072, + 0.08, + 0.09, + 0.098, + 0.104, + 0.108, + 0.11, + 0.108, + 0.102, + 0.094, + 0.084, + 0.072, + 0.05, + ], + "blue": [ + 0.06, + 0.072, + 0.084, + 0.096, + 0.106, + 0.116, + 0.124, + 0.13, + 0.132, + 0.128, + 0.122, + 0.11, + 0.096, + 0.08, + 0.064, + 0.044, + 0.023, + ], +} diff --git a/monobiome/curves.py b/monobiome/curves.py new file mode 100644 index 0000000..4680d08 --- /dev/null +++ b/monobiome/curves.py @@ -0,0 +1,114 @@ +import json +from pathlib import Path +from functools import cache + +import numpy as np + +from pprint import pprint +from coloraide import Color + +from monobiome.constants import ( + L_points, + L_resolution, + L_space, + + monotone_C_map, + h_weights, + h_L_offsets, + h_C_offsets, + + monotone_h_map, + accent_h_map, + h_map, +) + + +@cache +def max_C_Lh(L, h, space='srgb', eps=1e-6, tol=1e-9): + ''' + Binary search for max chroma at fixed lightness and hue + + Parameters: + L: lightness percentage + ''' + def C_in_gamut(C): + return Color('oklch', [L/100, C, h]).convert(space).in_gamut(tolerance=tol) + + lo, hi = 0.0, 0.1 + while C_in_gamut(hi): + hi *= 2 + while hi - lo > eps: + m = (lo + hi) / 2 + lo, hi = (m, hi) if C_in_gamut(m) else (lo, m) + + Cmax = lo + # c_oklch = Color('oklch', [L, Cmax, h]) + # c_srgb = c_oklch.convert('srgb') + + return Cmax + +def quad_bezier_rational(P0, P1, P2, w, t): + t = np.asarray(t)[:, None] + num = (1-t)**2*P0 + 2*w*(1-t)*t*P1 + t**2*P2 + den = (1-t)**2 + 2*w*(1-t)*t + t**2 + + return num/den + +def bezier_y_at_x(P0, P1, P2, w, x_query, n=400): + t = np.linspace(0, 1, n) + B = quad_bezier_rational(P0, P1, P2, w, t) + x_vals, y_vals = B[:, 0], B[:, 1] + + return np.interp(x_query, x_vals, y_vals) + + +# compute C max values over each point in L space +h_Lspace_Cmax = { + h_str: [max_C_Lh(_L, _h) for _L in L_space] + for h_str, _h in h_map.items() +} + +# compute *unbounded* chroma curves for all hues +h_L_points_C = {} +h_ctrl_L_C = {} + +for h_str, _h in monotone_h_map.items(): + h_L_points_C[h_str] = np.array([monotone_C_map[h_str]]*len(L_points)) + +for h_str, _h in accent_h_map.items(): + Lspace_Cmax = h_Lspace_Cmax[h_str] + + # get L value of max chroma; will be a bezier control + L_Cmax_idx = np.argmax(Lspace_Cmax) + L_Cmax = L_space[L_Cmax_idx] + + # offset control point by any preset x-shift + L_Cmax += h_L_offsets[h_str] + + # and get max C at the L offset + Cmax = max_C_Lh(L_Cmax, _h) + + # set 3 control points; shift by any global linear offest + C_offset = h_C_offsets.get(h_str, 0) + + p_0 = np.array([0, 0]) + p_Cmax = np.array([L_Cmax, Cmax + C_offset]) + p_100 = np.array([100, 0]) + + B_L_points = bezier_y_at_x(p_0, p_Cmax, p_100, h_weights.get(h_str, 1), L_points) + h_L_points_C[h_str] = B_L_points + h_ctrl_L_C[h_str] = np.vstack([p_0, p_Cmax, p_100]) + +# compute full set of final chroma curves; limits every point to in-gamut max +h_LC_color_map = {} +h_L_points_Cstar = {} + +for h_str, L_points_C in h_L_points_C.items(): + _h = h_map[h_str] + + h_L_points_Cstar[h_str] = [ + max(0, min(_C, max_C_Lh(_L, _h))) + for _L, _C in zip(L_points, L_points_C) + ] + +# if __name__ == "__main__": diff --git a/monobiome/plotting.py b/monobiome/plotting.py new file mode 100644 index 0000000..c494e9a --- /dev/null +++ b/monobiome/plotting.py @@ -0,0 +1,131 @@ +import matplotlib.pyplot as plt +from scipy.interpolate import interp1d, CubicSpline, BSpline + +from monobiome.constants import ( + L_points, + L_space, + h_weights, + monotone_h_map, + accent_h_map, + h_map, +) +from monobiome.curves import ( + h_L_points_Cstar, + h_Lspace_Cmax, +) + +ax_h_map = {} +fig, axes = plt.subplots( + len(monotone_h_map), + 1, + sharex=True, + sharey=True, + figsize=(4, 8) +) + +for i, h_str in enumerate(h_L_points_Cstar): + _h = h_map[h_str] + L_points_Cstar = h_L_points_Cstar[h_str] + L_space_Cmax = h_Lspace_Cmax[h_str] + + if _h not in ax_h_map: + ax_h_map[_h] = axes[i] + ax = ax_h_map[_h] + + # plot Cmax and Cstar + ax.plot(L_space, L_space_Cmax, c="b", alpha=0.2) + ax.plot(L_points, L_points_Cstar, alpha=0.7) + + ax.title.set_text(f"Hue [${_h}$]") + +axes[-1].set_xlabel("Lightness (%)") +axes[-1].set_xticks([L_points[0], L_points[-1]]) + +fig.tight_layout() +fig.subplots_adjust(top=0.9) + +plt.suptitle("$C^*$ curves for hue groups") +plt.show() + + + +ax_h_map = {} +fig, axes = plt.subplots( + len(monotone_h_map), + 1, + sharex=True, + sharey=True, + figsize=(5, 10) +) + +for i, h_str in enumerate(h_L_points_Cstar): + _h = h_map[h_str] + L_points_Cstar = h_L_points_Cstar[h_str] + L_space_Cmax = h_Lspace_Cmax[h_str] + + if _h not in ax_h_map: + ax_h_map[_h] = axes[i] + ax = ax_h_map[_h] + + # plot Cmax and Cstar + ax.plot(L_space, L_space_Cmax, c="b", alpha=0.2, label='Cmax') + ax.plot(L_points, L_points_Cstar, alpha=0.7, label='C*') + + if h_str in v111_hC_points: + ax.scatter(v111_L_space, v111_hC_points[h_str], s=4, label='Cv111') + + if h_str in h_ctrl_L_C: + cpts = h_ctrl_L_C[h_str] + cpt_x, cpt_y = cpts[:, 0], cpts[:, 1] + h_w = h_weights.get(h_str, 1) + + P0, P1, P2 = cpts[0], cpts[1], cpts[2] + d0 = 2 * h_w * (P1 - P0) + d2 = 2 * h_w * (P2 - P1) + + handle_scale = 0.25 + H0 = P0 + handle_scale * d0 + H2 = P2 - handle_scale * d2 + + # ax.plot([P0[0], H0[0]], [P0[1], H0[1]], color='tab:blue', lw=1) + # ax.plot([P2[0], H2[0]], [P2[1], H2[1]], color='tab:orange', lw=1) + + ax.plot(cpt_x, cpt_y, '--', color='gray', lw=1, label='Bezier polygon') + ax.scatter(cpt_x, cpt_y, color='red', zorder=5, s=2, label='Control points') + + ax.title.set_text(f"Hue [${_h}$]") + +axes[-1].set_ylabel("Chroma (C)") +axes[-1].set_xlabel("Lightness (%)") +axes[-1].set_xticks([L_points[0], 50, 65, L_points[-1]]) + +fig.tight_layout() +fig.subplots_adjust(top=0.9) + +handles, labels = axes[-1].get_legend_handles_labels() +unique = dict(zip(labels, handles)) +fig.legend(unique.values(), unique.keys(), loc='lower center', bbox_to_anchor=(0.5, -0.06), ncol=3) + +plt.suptitle("$C^*$ curves for hue groups + v111 5% lightness") +plt.show() + + + + +from numpy import arctan2, degrees + +fig, ax = plt.subplots(1, 1, figsize=(8, 6)) + +for h_str in h_L_points_Cstar: + if h_str not in accent_h_map: + continue + ax.fill_between(L_points, h_L_points_Cstar[h_str], alpha=0.2, color='grey', label=h_str) + + x, y = L_points, h_L_points_Cstar[h_str] + n = int(0.5*len(x)) + ax.text(x[n], y[n]-0.01, h_str, rotation=10, va='center', ha='left') + +ax.set_xlabel("Lightness (%)") +ax.set_xticks([L_points[0], 45, 50, 55, 60, 65, 70, L_points[-1]]) +plt.suptitle("$C^*$ curves (v1.3.0)") +fig.show() diff --git a/monobiome/schemes.py b/monobiome/schemes.py new file mode 100644 index 0000000..8bd4f5d --- /dev/null +++ b/monobiome/schemes.py @@ -0,0 +1,140 @@ +def compute_dma_map(dT, metric=None): + """ + For threshold `dT`, compute the nearest accent shades + that exceed that threshold for every monotone shade. + + Returns: + + Map like + { "alpine": { + "oklch( ... )": { + "red": *nearest oklch >= dT from M base* + """ + + if metric is None: + metric = lambda mc,ac: mc.distance(ac, space="oklch") + + oklch_color_map = { + c_name: [Color(c_str) for c_str in c_str_dict.values()] + for c_name, c_str_dict in oklch_hL_dict.items() + } + + dT_mL_acol_map = {} + for m_name in monotone_h_map: + mL_acol_map = {} + m_colors = oklch_color_map[m_name] + + for m_color in m_colors: + acol_min_map = {} + + for a_name in accent_h_map: + a_colors = oklch_color_map[a_name] + oklch_dists = filter( + lambda d: (d[1] - dT) > 0, + [ + (ac, metric(m_color, ac)) + for ac in a_colors + ] + ) + oklch_dists = list(oklch_dists) + if oklch_dists: + min_a_color = min(oklch_dists, key=lambda t: t[1])[0] + acol_min_map[a_name] = min_a_color + + # make sure the current monotone level has *all* accents; o/w ignore + if len(acol_min_map) < len(accent_h_map): + continue + + mL = m_color.coords()[0] + mL_acol_map[int(mL*100)] = acol_min_map + dT_mL_acol_map[m_name] = mL_acol_map + return dT_mL_acol_map + + + + + + +mode = "dark" # ["dark", "light"] +biome = "alpine" # [ ... ] +metric = "wcag" # ["wcag", "oklch"] +metric_map = { + "wcag": lambda mc,ac: ac.contrast(mc, method='wcag21'), + "oklch": lambda mc,ac: mc.distance(ac, space="oklch"), +} +metric_func = metric_map[metric] + +term_color_map = { + "red": "red", + "organge": "orange", + "yellow": "yellow", + "green": "green", + "cyan": "green", + "blue": "blue", + "violet": "blue", + "magenta": "red", +} + +L = 20 +d = 4.5 +I = 5 +fg_gap = 50 +grey_gap = 30 + +dT_mL_acol_map = compute_dma_map(d, metric=metric_func) +Lma_map = { + m_name: mL_acol_dict[L] + for m_name, mL_acol_dict in dT_mL_acol_map.items() + if L in mL_acol_dict +} + +# the `mL_acol_dict` only includes lightnesses where all accent +# colors were within threshold. Coverage here will be partial if, +# at the `mL`, there is some monotone base that doesn't have all +# accents within threshold. This can happen at the edge, e.g., alpine@L15 +# has all accents w/in the distance, but the red accent was too far under +# tundra@L15, so there's no entry. This particular case is fairly rare; it's +# more likely that *all* monotones are undefined. Either way, both such +# cases lead to partial scheme coverage. +if len(Lma_map) < len(monotone_h_map): + print(f"Warning: partial scheme coverage for {mL=}@{dT=}") +if biome not in Lma_map: + print(f"Biome {biome} unable to meet {metric} constraints") +accent_colors = Lma_map.get(biome, {}) + +scheme_pairs = [] +for i in range(4): + scheme_pairs.append( + ( + f"bg{i}", + f"f{{{{{biome}.l{L+i*I}}}}}" + ) + ) +for i in range(4): + scheme_pairs.append( + ( + f"fg{3-i}", + f"f{{{{{biome}.l{fg_gap+L+i*I}}}}}" + ) + ) +for term_color, mb_accent in term_color_map.items(): + aL = int(100*accent_colors[mb_accent].coords()[0]) + scheme_pairs.append( + ( + f"{term_color}", + f"f{{{{{mb_accent}.l{aL}}}}}" + ) + ) + +term_fg_gap = 60 +scheme_pairs.extend([ + ("background", f"f{{{{{biome}.l{L}}}}}"), + ("selection_bg", f"f{{{{{biome}.l{L+I}}}}}"), + ("selection_fg", f"f{{{{{biome}.l{L+term_fg_gap}}}}}"), + ("foreground", f"f{{{{{biome}.l{L+term_fg_gap+I}}}}}"), +]) + +scheme_toml = [ + f"{lhs:<12} = {rhs:<16}" + for lhs, rhs in scheme_pairs +] diff --git a/monobiome/writer.py b/monobiome/writer.py new file mode 100644 index 0000000..c444b08 --- /dev/null +++ b/monobiome/writer.py @@ -0,0 +1,39 @@ + +# put together objects for output formats +toml_lines = [] +oklch_hL_dict = {} + +for h_str, L_points_Cstar in h_L_points_Cstar.items(): + _h = h_map[h_str] + toml_lines.append(f"[{h_str}]") + oklch_hL_dict[h_str] = {} + + for _L, _C in zip(L_points, L_points_Cstar): + oklch = Color('oklch', [_L/100, _C, _h]) + srgb = oklch.convert('srgb') + + hex_str = srgb.to_string(hex=True) + + l, c, h = oklch.convert('oklch').coords() + # oklch_str = oklch.to_string(percent=False) + oklch_str = f"oklch({l*100:.1f}% {c:.4f} {h:.1f})" + + toml_lines.append(f'l{_L} = "{hex_str}"') + oklch_hL_dict[h_str][_L] = oklch_str + + toml_lines.append("") + + + +# write files -- QBR = "quadratic bezier rational" +PALETTE_DIR = "palettes" + +toml_content = '\n'.join(toml_lines) +with Path(PALETTE_DIR, 'monobiome-vQBRsn-130.toml').open('w') as f: + f.write(toml_content) +print("[TOML] written") + +with Path(PALETTE_DIR, 'monobiome-vQBRsn-130-oklch.json').open('w') as f: + json.dump(oklch_hL_dict, f) +print("[JSON] written") + diff --git a/notebooks/figures/mb_contrast_r50.gif b/notebooks/figures/mb_contrast_r50.gif index a0064a2..3b8c2cd 100644 Binary files a/notebooks/figures/mb_contrast_r50.gif and b/notebooks/figures/mb_contrast_r50.gif differ diff --git a/notebooks/figures/mb_sphere.gif b/notebooks/figures/mb_sphere.gif index bafa1af..ee2a9da 100644 Binary files a/notebooks/figures/mb_sphere.gif and b/notebooks/figures/mb_sphere.gif differ diff --git a/notebooks/figures/mb_trajectories.gif b/notebooks/figures/mb_trajectories.gif index e179b1b..d11dd56 100644 Binary files a/notebooks/figures/mb_trajectories.gif and b/notebooks/figures/mb_trajectories.gif differ diff --git a/notebooks/monobiome_qbr-shapenorm-v130.ipynb b/notebooks/monobiome_qbr-shapenorm-v130.ipynb index eea3dcf..f7be5b2 100644 --- a/notebooks/monobiome_qbr-shapenorm-v130.ipynb +++ b/notebooks/monobiome_qbr-shapenorm-v130.ipynb @@ -618,7 +618,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 22, "id": "a4b66b95-2c86-452f-bef4-1e3716ab9555", "metadata": {}, "outputs": [], @@ -703,49 +703,46 @@ "])\n", "\n", "scheme_toml = [\n", - " f\"{lhs:<8} = {rhs:<15}\"\n", + " f\"{lhs:<12} = {rhs:<16}\"\n", " for lhs, rhs in scheme_pairs\n", "] " ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 23, "id": "908e409c-803f-401d-a5c7-d7fc73aeea9d", "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "['bg0 = f{{alpine.l20}}',\n", - " 'bg1 = f{{alpine.l25}}',\n", - " 'bg2 = f{{alpine.l30}}',\n", - " 'bg3 = f{{alpine.l35}}',\n", - " 'fg3 = f{{alpine.l70}}',\n", - " 'fg2 = f{{alpine.l75}}',\n", - " 'fg1 = f{{alpine.l80}}',\n", - " 'fg0 = f{{alpine.l85}}',\n", - " 'red = f{{red.l62}} ',\n", - " 'organge = f{{orange.l61}}',\n", - " 'yellow = f{{yellow.l60}}',\n", - " 'green = f{{green.l59}} ',\n", - " 'cyan = f{{green.l59}} ',\n", - " 'blue = f{{blue.l60}} ',\n", - " 'violet = f{{blue.l60}} ',\n", - " 'magenta = f{{red.l62}} ',\n", - " 'background = f{{alpine.l20}}',\n", - " 'selection_bg = f{{alpine.l25}}',\n", - " 'selection_fg = f{{alpine.l80}}',\n", - " 'foreground = f{{alpine.l85}}']" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "bg0 = f{{alpine.l20}} \n", + "bg1 = f{{alpine.l25}} \n", + "bg2 = f{{alpine.l30}} \n", + "bg3 = f{{alpine.l35}} \n", + "fg3 = f{{alpine.l70}} \n", + "fg2 = f{{alpine.l75}} \n", + "fg1 = f{{alpine.l80}} \n", + "fg0 = f{{alpine.l85}} \n", + "red = f{{red.l62}} \n", + "organge = f{{orange.l61}} \n", + "yellow = f{{yellow.l60}} \n", + "green = f{{green.l59}} \n", + "cyan = f{{green.l59}} \n", + "blue = f{{blue.l60}} \n", + "violet = f{{blue.l60}} \n", + "magenta = f{{red.l62}} \n", + "background = f{{alpine.l20}} \n", + "selection_bg = f{{alpine.l25}} \n", + "selection_fg = f{{alpine.l80}} \n", + "foreground = f{{alpine.l85}} \n" + ] } ], "source": [ - "scheme_toml" + "print('\\n'.join(scheme_toml))" ] }, { diff --git a/remove_big_ipynb.py b/remove_big_ipynb.py new file mode 100644 index 0000000..88f668a --- /dev/null +++ b/remove_big_ipynb.py @@ -0,0 +1,10 @@ +import os + +threshold = 5 * 1024 * 1024 + +def blob_callback(blob, metadata): + if not blob.path.endswith(b'.ipynb'): + return + if len(blob.data) <= threshold: + return + blob.skip() diff --git a/templates/apps/firefox/templates/none-dark.auto-manifest.json b/templates/apps/firefox/templates/none-dark.auto-manifest.json index 0542cf3..f5ef8cc 100644 --- a/templates/apps/firefox/templates/none-dark.auto-manifest.json +++ b/templates/apps/firefox/templates/none-dark.auto-manifest.json @@ -1,6 +1,6 @@ { "manifest_version": 2, - "version": "1.2.0", + "version": "f{{theme.version}}", "name": "monobiome-f{{theme.biome}}", "theme": { "colors": { diff --git a/templates/apps/firefox/templates/none-dark.dark-manifest.json b/templates/apps/firefox/templates/none-dark.dark-manifest.json index 1bd597a..f624368 100644 --- a/templates/apps/firefox/templates/none-dark.dark-manifest.json +++ b/templates/apps/firefox/templates/none-dark.dark-manifest.json @@ -1,6 +1,6 @@ { "manifest_version": 2, - "version": "1.2.0", + "version": "f{{theme.version}}", "name": "monobiome-f{{theme.biome}}-dark", "theme": { "colors": { diff --git a/templates/apps/firefox/templates/none-dark.light-manifest.json b/templates/apps/firefox/templates/none-dark.light-manifest.json index 0fd0e79..539deac 100644 --- a/templates/apps/firefox/templates/none-dark.light-manifest.json +++ b/templates/apps/firefox/templates/none-dark.light-manifest.json @@ -1,6 +1,6 @@ { "manifest_version": 2, - "version": "1.2.0", + "version": "f{{theme.version}}", "name": "monobiome-f{{theme.biome}}-light", "theme": { "colors": { diff --git a/templates/groups/theme/default-alpine-monobiome-dark.toml b/templates/groups/theme/default-alpine-monobiome-dark.toml index 41c5dae..9dfbcdb 100644 --- a/templates/groups/theme/default-alpine-monobiome-dark.toml +++ b/templates/groups/theme/default-alpine-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "alpine" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/default-alpine-monobiome-light.toml b/templates/groups/theme/default-alpine-monobiome-light.toml index dc82b60..4b85916 100644 --- a/templates/groups/theme/default-alpine-monobiome-light.toml +++ b/templates/groups/theme/default-alpine-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "alpine" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/default-badlands-monobiome-dark.toml b/templates/groups/theme/default-badlands-monobiome-dark.toml index 89783e6..a7e74a8 100644 --- a/templates/groups/theme/default-badlands-monobiome-dark.toml +++ b/templates/groups/theme/default-badlands-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "badlands" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/default-badlands-monobiome-light.toml b/templates/groups/theme/default-badlands-monobiome-light.toml index cf8093d..81df648 100644 --- a/templates/groups/theme/default-badlands-monobiome-light.toml +++ b/templates/groups/theme/default-badlands-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "badlands" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/default-chaparral-monobiome-dark.toml b/templates/groups/theme/default-chaparral-monobiome-dark.toml index 3d25dfc..7a62685 100644 --- a/templates/groups/theme/default-chaparral-monobiome-dark.toml +++ b/templates/groups/theme/default-chaparral-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "chaparral" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/default-chaparral-monobiome-light.toml b/templates/groups/theme/default-chaparral-monobiome-light.toml index 118a899..9b25ee6 100644 --- a/templates/groups/theme/default-chaparral-monobiome-light.toml +++ b/templates/groups/theme/default-chaparral-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "chaparral" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/default-grassland-monobiome-dark.toml b/templates/groups/theme/default-grassland-monobiome-dark.toml index 0f37cce..cff0492 100644 --- a/templates/groups/theme/default-grassland-monobiome-dark.toml +++ b/templates/groups/theme/default-grassland-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "grassland" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/default-grassland-monobiome-light.toml b/templates/groups/theme/default-grassland-monobiome-light.toml index 1b4eda7..0ef017f 100644 --- a/templates/groups/theme/default-grassland-monobiome-light.toml +++ b/templates/groups/theme/default-grassland-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "grassland" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/default-savanna-monobiome-dark.toml b/templates/groups/theme/default-savanna-monobiome-dark.toml index fff681f..a4f0d84 100644 --- a/templates/groups/theme/default-savanna-monobiome-dark.toml +++ b/templates/groups/theme/default-savanna-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "savanna" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/default-savanna-monobiome-light.toml b/templates/groups/theme/default-savanna-monobiome-light.toml index 18ac116..55d84a8 100644 --- a/templates/groups/theme/default-savanna-monobiome-light.toml +++ b/templates/groups/theme/default-savanna-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "savanna" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/default-tundra-monobiome-dark.toml b/templates/groups/theme/default-tundra-monobiome-dark.toml index 74c9b4f..10523f6 100644 --- a/templates/groups/theme/default-tundra-monobiome-dark.toml +++ b/templates/groups/theme/default-tundra-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "tundra" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/default-tundra-monobiome-light.toml b/templates/groups/theme/default-tundra-monobiome-light.toml index 49b700f..78d6bf1 100644 --- a/templates/groups/theme/default-tundra-monobiome-light.toml +++ b/templates/groups/theme/default-tundra-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "tundra" contrast = "default" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-alpine-monobiome-dark.toml b/templates/groups/theme/hard-alpine-monobiome-dark.toml index adabacd..814aa99 100644 --- a/templates/groups/theme/hard-alpine-monobiome-dark.toml +++ b/templates/groups/theme/hard-alpine-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "alpine" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-alpine-monobiome-light.toml b/templates/groups/theme/hard-alpine-monobiome-light.toml index e023cdf..e5d14e4 100644 --- a/templates/groups/theme/hard-alpine-monobiome-light.toml +++ b/templates/groups/theme/hard-alpine-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "alpine" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-badlands-monobiome-dark.toml b/templates/groups/theme/hard-badlands-monobiome-dark.toml index cff88f2..503a894 100644 --- a/templates/groups/theme/hard-badlands-monobiome-dark.toml +++ b/templates/groups/theme/hard-badlands-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "badlands" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-badlands-monobiome-light.toml b/templates/groups/theme/hard-badlands-monobiome-light.toml index 9185ee2..05790b3 100644 --- a/templates/groups/theme/hard-badlands-monobiome-light.toml +++ b/templates/groups/theme/hard-badlands-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "badlands" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-chaparral-monobiome-dark.toml b/templates/groups/theme/hard-chaparral-monobiome-dark.toml index 80f67c2..e2e06da 100644 --- a/templates/groups/theme/hard-chaparral-monobiome-dark.toml +++ b/templates/groups/theme/hard-chaparral-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "chaparral" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-chaparral-monobiome-light.toml b/templates/groups/theme/hard-chaparral-monobiome-light.toml index 26a11a2..fe102b4 100644 --- a/templates/groups/theme/hard-chaparral-monobiome-light.toml +++ b/templates/groups/theme/hard-chaparral-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "chaparral" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-grassland-monobiome-dark.toml b/templates/groups/theme/hard-grassland-monobiome-dark.toml index 67695b9..ae40623 100644 --- a/templates/groups/theme/hard-grassland-monobiome-dark.toml +++ b/templates/groups/theme/hard-grassland-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "grassland" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-grassland-monobiome-light.toml b/templates/groups/theme/hard-grassland-monobiome-light.toml index b3549e7..34b0290 100644 --- a/templates/groups/theme/hard-grassland-monobiome-light.toml +++ b/templates/groups/theme/hard-grassland-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "grassland" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-savanna-monobiome-dark.toml b/templates/groups/theme/hard-savanna-monobiome-dark.toml index 83ddc64..c408474 100644 --- a/templates/groups/theme/hard-savanna-monobiome-dark.toml +++ b/templates/groups/theme/hard-savanna-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "savanna" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-savanna-monobiome-light.toml b/templates/groups/theme/hard-savanna-monobiome-light.toml index 6a0df39..c0baf38 100644 --- a/templates/groups/theme/hard-savanna-monobiome-light.toml +++ b/templates/groups/theme/hard-savanna-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "savanna" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-tundra-monobiome-dark.toml b/templates/groups/theme/hard-tundra-monobiome-dark.toml index 983660f..51d0178 100644 --- a/templates/groups/theme/hard-tundra-monobiome-dark.toml +++ b/templates/groups/theme/hard-tundra-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "tundra" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/hard-tundra-monobiome-light.toml b/templates/groups/theme/hard-tundra-monobiome-light.toml index 2352364..313ee66 100644 --- a/templates/groups/theme/hard-tundra-monobiome-light.toml +++ b/templates/groups/theme/hard-tundra-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "tundra" contrast = "hard" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-alpine-monobiome-dark.toml b/templates/groups/theme/soft-alpine-monobiome-dark.toml index dcb3f38..64693b5 100644 --- a/templates/groups/theme/soft-alpine-monobiome-dark.toml +++ b/templates/groups/theme/soft-alpine-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "alpine" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-alpine-monobiome-light.toml b/templates/groups/theme/soft-alpine-monobiome-light.toml index 3be8cff..9b7064c 100644 --- a/templates/groups/theme/soft-alpine-monobiome-light.toml +++ b/templates/groups/theme/soft-alpine-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "alpine" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-badlands-monobiome-dark.toml b/templates/groups/theme/soft-badlands-monobiome-dark.toml index 3cfcbb6..4ca4ce5 100644 --- a/templates/groups/theme/soft-badlands-monobiome-dark.toml +++ b/templates/groups/theme/soft-badlands-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "badlands" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-badlands-monobiome-light.toml b/templates/groups/theme/soft-badlands-monobiome-light.toml index 287e87c..8d82d37 100644 --- a/templates/groups/theme/soft-badlands-monobiome-light.toml +++ b/templates/groups/theme/soft-badlands-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "badlands" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-chaparral-monobiome-dark.toml b/templates/groups/theme/soft-chaparral-monobiome-dark.toml index 29e40c8..bc7cb0e 100644 --- a/templates/groups/theme/soft-chaparral-monobiome-dark.toml +++ b/templates/groups/theme/soft-chaparral-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "chaparral" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-chaparral-monobiome-light.toml b/templates/groups/theme/soft-chaparral-monobiome-light.toml index 5b54246..eb46f3c 100644 --- a/templates/groups/theme/soft-chaparral-monobiome-light.toml +++ b/templates/groups/theme/soft-chaparral-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "chaparral" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-grassland-monobiome-dark.toml b/templates/groups/theme/soft-grassland-monobiome-dark.toml index ba60eb0..c587708 100644 --- a/templates/groups/theme/soft-grassland-monobiome-dark.toml +++ b/templates/groups/theme/soft-grassland-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "grassland" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-grassland-monobiome-light.toml b/templates/groups/theme/soft-grassland-monobiome-light.toml index 8ed96aa..20b4f0a 100644 --- a/templates/groups/theme/soft-grassland-monobiome-light.toml +++ b/templates/groups/theme/soft-grassland-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "grassland" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-savanna-monobiome-dark.toml b/templates/groups/theme/soft-savanna-monobiome-dark.toml index a699ce5..e646147 100644 --- a/templates/groups/theme/soft-savanna-monobiome-dark.toml +++ b/templates/groups/theme/soft-savanna-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "savanna" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-savanna-monobiome-light.toml b/templates/groups/theme/soft-savanna-monobiome-light.toml index 0619d48..70056cd 100644 --- a/templates/groups/theme/soft-savanna-monobiome-light.toml +++ b/templates/groups/theme/soft-savanna-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "savanna" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-tundra-monobiome-dark.toml b/templates/groups/theme/soft-tundra-monobiome-dark.toml index 91df3ca..892aa78 100644 --- a/templates/groups/theme/soft-tundra-monobiome-dark.toml +++ b/templates/groups/theme/soft-tundra-monobiome-dark.toml @@ -11,6 +11,7 @@ mode = "dark" biome = "tundra" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS -------------------------------------- diff --git a/templates/groups/theme/soft-tundra-monobiome-light.toml b/templates/groups/theme/soft-tundra-monobiome-light.toml index f97bc19..599f656 100644 --- a/templates/groups/theme/soft-tundra-monobiome-light.toml +++ b/templates/groups/theme/soft-tundra-monobiome-light.toml @@ -11,6 +11,7 @@ mode = "light" biome = "tundra" contrast = "soft" +version = "f{{version}}" # -------------------------------------------- # - SYS --------------------------------------