diff --git a/.gitignore b/.gitignore index 86e4022..a7064fe 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ __pycache__/ .ipynb_checkpoints/ .pytest_cache/ .python-version +.venv/ # vendor and build files dist/ @@ -14,7 +15,6 @@ docs/_autosummary/ docs/_build/ # local -notebooks/ /Makefile data/ diff --git a/DESIGN.md b/DESIGN.md index ec37513..4f0764a 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -86,18 +86,18 @@ reach >4.5 WCAG 2 contrast ratio (the standard requirement for small text on the web) against all biome monotones for each theme: + For BG l20 (harsh, dark) -> l65 is min lightness where all accents have CR - >=4.5 + ≥4.5 + For BG l25 (regular, dark) -> l65 is min lightness where all accents have CR - >=4.5 + ≥4.5 + For BG l30 (soft, dark) -> l70 is min lightness where all accents have CR - >=4.5 + ≥4.5 + For BG l90 (harsh, dark) -> l45 is max lightness where all accents have CR - >=4.5 + ≥4.5 + For BG l85 (regular, dark) -> l45 is min lightness where all accents have CR - >=4.5 + ≥4.5 + For BG l80 (soft, dark) -> l40 is min lightness where all accents have CR - >=4.5 + ≥4.5 For the monotone boundaries (l15 and l95, neither of which are possible backgrounds for terminal or nvim in the current theme definitions), the diff --git a/notebooks/color_spaces.ipynb b/notebooks/color_spaces.ipynb new file mode 100644 index 0000000..2cb5d75 --- /dev/null +++ b/notebooks/color_spaces.ipynb @@ -0,0 +1,518 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "1abfc7de-3ced-4407-b38e-3fc276b6a133", + "metadata": {}, + "outputs": [], + "source": [ + "import math\n", + "import json\n", + "from pathlib import Path\n", + "\n", + "import plotly.io as pio\n", + "import plotly.graph_objects as go\n", + "from coloraide import Color\n", + "\n", + "import gamut_3d_plotly as diagrams\n", + "\n", + "pio.renderers\n", + "pio.renderers.default = \"notebook_connected\"\n", + "\n", + "\n", + "def face_radial_plane(fig, theta_deg, r=2.5, tilt_deg=0):\n", + " # normal in xy\n", + " nx = -math.sin(math.radians(theta_deg))\n", + " ny = math.cos(math.radians(theta_deg))\n", + "\n", + " # allow optional tilt up/down so it's not perfectly horizontal\n", + " tilt = math.radians(tilt_deg) # 0 => horizontal view, positive looks slightly downward\n", + " ex = r * nx * math.cos(tilt)\n", + " ey = r * ny * math.cos(tilt)\n", + " ez = r * math.sin(tilt)\n", + "\n", + " fig.update_layout(\n", + " scene_camera=dict(\n", + " eye=dict(x=ex, y=ey, z=ez),\n", + " center=dict(x=0, y=0, z=0),\n", + " up=dict(x=0, y=0, z=1)\n", + " )\n", + " )\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "642b3763-f250-4e24-bd4c-2a080772467d", + "metadata": {}, + "outputs": [], + "source": [ + "PALETTE_DIR = \"palettes\"\n", + "\n", + "with Path(PALETTE_DIR, \"monobiome-v111-oklch.json\").open(\"rb\") as f:\n", + " mb_v111_dict = json.load(f)\n", + "with Path(PALETTE_DIR, \"monobiome-vUCC-oklch.json\").open(\"rb\") as f:\n", + " mb_vUCC_dict = json.load(f)\n", + "with Path(PALETTE_DIR, \"monobiome-vMCL-oklch.json\").open(\"rb\") as f:\n", + " mb_vMCL_dict = json.load(f)\n", + "with Path(PALETTE_DIR, \"monobiome-vQBR-oklch.json\").open(\"rb\") as f:\n", + " mb_vQBR_dict = json.load(f)\n", + "with Path(PALETTE_DIR, \"monobiome-vQBRsn-oklch.json\").open(\"rb\") as f:\n", + " mb_vQBRsn_dict = json.load(f)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "0e778a92-78fa-40eb-8b4f-51fbbbc9eb0a", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "===> Generating oklch model...\n" + ] + }, + { + "data": { + "text/html": [ + " \n", + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "