From 160f41454380572e70e09d2eeedd00e437096b54 Mon Sep 17 00:00:00 2001 From: Patrick Perkins Date: Fri, 24 Jul 2026 17:02:40 -0400 Subject: [PATCH 1/2] feat: integrate tinted-fzf into tinty theming Add tinted-fzf repo to tinty config.toml with a hook script that generates a clean ~/.config/fzf/tinted.sh from the current scheme. Source the generated file from .zshrc so fzf colors match the active base16/base24 theme. The hook writes FZF_DEFAULT_OPTS with a clean --color= flag (no appending) so switching schemes mid-session doesn't bloat the env var. --- .../.config/tinted-theming/tinty/config.toml | 27 ++++++++++- .../tinty/scripts/tinty-fzf-theme.sh | 47 +++++++++++++++++++ zsh/.zshrc | 3 ++ 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100755 tinted-theming/.config/tinted-theming/tinty/scripts/tinty-fzf-theme.sh diff --git a/tinted-theming/.config/tinted-theming/tinty/config.toml b/tinted-theming/.config/tinted-theming/tinty/config.toml index cccbf52..c4145be 100644 --- a/tinted-theming/.config/tinted-theming/tinty/config.toml +++ b/tinted-theming/.config/tinted-theming/tinty/config.toml @@ -1,5 +1,6 @@ # Global settings -shell = "zsh -c '{}'" # This tells Tinty how to run hooks +# Use default shell (sh -c) for fast hook execution — zsh -c loads all startup files. +# If you need zsh for specific hooks, add [[ -o interactive ]] || return to .zshenv. default-scheme = "base16-tarot" # Default theme when none is specified # ghostty @@ -15,3 +16,27 @@ path = "https://github.com/tinted-theming/tinted-tmux" name = "tinted-tmux" hook = "tmux source-file ~/.config/tmux/tmux.conf" themes-dir = "colors" + +# pi (coding agent) +[[items]] +path = "https://github.com/body-clock/tinted-pi" +name = "tinted-pi" +hook = "mkdir -p ~/.pi/agent/themes && cp -f %f ~/.pi/agent/themes/tinted.json" +themes-dir = "themes" +supported-systems = ["base16", "base24"] + +# tuicr (code review TUI) — generates theme + syntax highlighting from current scheme +[[items]] +path = "https://github.com/body-clock/tinted-tuicr" +name = "tinted-tuicr" +hook = "bash ~/.local/share/tinted-theming/tinty/repos/tinted-tuicr/scripts/generate.sh" +themes-dir = "themes" +supported-systems = ["base16"] + +# fzf — generates color flags from current scheme +[[items]] +path = "https://github.com/tinted-theming/tinted-fzf" +name = "tinted-fzf" +hook = "bash ~/.config/tinted-theming/tinty/scripts/tinty-fzf-theme.sh %f" +themes-dir = "sh" + diff --git a/tinted-theming/.config/tinted-theming/tinty/scripts/tinty-fzf-theme.sh b/tinted-theming/.config/tinted-theming/tinty/scripts/tinty-fzf-theme.sh new file mode 100755 index 0000000..0e6361e --- /dev/null +++ b/tinted-theming/.config/tinted-theming/tinty/scripts/tinty-fzf-theme.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# tinty-fzf-theme.sh — Generate a clean fzf theme from the current tinty scheme +# +# tinty passes the generated file path as %f. We extract the --color flags +# from it and write a clean ~/.config/fzf/tinted.sh that sets FZF_DEFAULT_OPTS +# without appending (avoids unbounded growth when schemes change). +# +# Hook into tinty config.toml: +# [[items]] +# path = "https://github.com/tinted-theming/tinted-fzf" +# name = "tinted-fzf" +# hook = "bash ~/.config/tinted-theming/tinty/scripts/tinty-fzf-theme.sh %f" +# themes-dir = "sh" + +set -euo pipefail + +GENERATED_FILE="${1:?Usage: tinty-fzf-theme.sh }" +FZF_THEME_DIR="${HOME}/.config/fzf" +FZF_THEME_FILE="${FZF_THEME_DIR}/tinted.sh" + +if [ ! -f "$GENERATED_FILE" ]; then + echo "[tinty-fzf] ERROR: generated file not found: $GENERATED_FILE" >&2 + exit 1 +fi + +# Extract the scheme name from the comment header +SCHEME_NAME=$(sed -n '1s/^# Scheme name: //p' "$GENERATED_FILE" | tr -d '[:space:]') +SCHEME_SYSTEM=$(sed -n '2s/^# Scheme system: //p' "$GENERATED_FILE" | tr -d '[:space:]') + +# Extract the --color= flags from the FZF_DEFAULT_OPTS export. +# The generated file has one --color flag per line, spread across +# multiple continuation lines like: +# " --color=bg+:#2a153c,bg:#0e091d,spinner:#8c9785,hl:#6e6080"\ +# We extract the value portion after --color= from each line and join with commas. +COLOR_PARTS=$(sed -n 's/.*--color=\([^"]*\).*/\1/p' "$GENERATED_FILE" | paste -sd ',' -) + +# Build clean export — replace, don't append, so scheme changes don't bloat FZF_DEFAULT_OPTS +mkdir -p "$FZF_THEME_DIR" + +cat > "$FZF_THEME_FILE" << EOF +# tinted-fzf theme — generated by tinty +# Scheme: ${SCHEME_NAME} (${SCHEME_SYSTEM}) + +export FZF_DEFAULT_OPTS="--color=${COLOR_PARTS}" +EOF + +echo "[tinty-fzf] wrote theme → $FZF_THEME_FILE (${SCHEME_NAME})" >&2 diff --git a/zsh/.zshrc b/zsh/.zshrc index 0d3b608..9974fb3 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -34,5 +34,8 @@ source $(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme # Set up fzf key bindings and fuzzy completion source <(fzf --zsh) +# tinted-theming fzf colors (generated by tinty) +[[ -f ~/.config/fzf/tinted.sh ]] && source ~/.config/fzf/tinted.sh + # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh From 02beccfaef99cd4fa833bd1c1ad5b85365cc8242 Mon Sep 17 00:00:00 2001 From: Patrick Perkins Date: Thu, 13 Aug 2026 10:56:31 -0400 Subject: [PATCH 2/2] feat: add tinty theme hooks for pi and tuicr Generate ~/.pi/agent/themes/tinted.json and ~/.config/tuicr/themes/tinted.toml from tinty's current scheme, alongside the existing fzf hook. --- .../tinty/scripts/tinty-pi-theme.sh | 218 +++++++++ .../tinty/scripts/tinty-tuicr-theme.sh | 433 ++++++++++++++++++ 2 files changed, 651 insertions(+) create mode 100755 tinted-theming/.config/tinted-theming/tinty/scripts/tinty-pi-theme.sh create mode 100755 tinted-theming/.config/tinted-theming/tinty/scripts/tinty-tuicr-theme.sh diff --git a/tinted-theming/.config/tinted-theming/tinty/scripts/tinty-pi-theme.sh b/tinted-theming/.config/tinted-theming/tinty/scripts/tinty-pi-theme.sh new file mode 100755 index 0000000..135d930 --- /dev/null +++ b/tinted-theming/.config/tinted-theming/tinty/scripts/tinty-pi-theme.sh @@ -0,0 +1,218 @@ +#!/usr/bin/env bash +# tinty-pi-theme.sh — Generate a pi agent theme from the current tinty scheme +# +# Reads tinty's current-scheme state, finds the palette YAML, maps base16/base24 +# colors to pi's 51 semantic colour tokens, and writes ~/.pi/agent/themes/tinted.json. +# Pi hot-reloads the theme automatically when the file changes. +# +# Hook into tinty config.toml: +# [[items]] +# name = "pi-agent" +# path = "https://github.com/tinted-theming/base16-schemes" +# hook = "~/.config/tinted-theming/tinty/scripts/tinty-pi-theme.sh" +# themes-dir = "." +# +# Or simpler: chain it onto an existing hook in config.toml, e.g. the ghostty hook: +# hook = "cp -f %f … && … && ~/.config/tinted-theming/tinty/scripts/tinty-pi-theme.sh" + +set -euo pipefail + +# ── Configuration ────────────────────────────────────────────────────────── +TINTY_DATA="${TINTY_DATA:-$HOME/.local/share/tinted-theming/tinty}" +TINTY_SCHEMES="${TINTY_DATA}/repos/schemes" +TINTY_CUSTOM="${TINTY_DATA}/custom-schemes" +TINTY_STATE="${TINTY_DATA}/current_scheme" + +PI_THEMES="${HOME}/.pi/agent/themes" +PI_THEME_FILE="${PI_THEMES}/tinted.json" + +# ── Step 1 — grab current scheme name from tinty state ──────────────────── +if [ ! -f "$TINTY_STATE" ]; then + echo "[tinty-pi-theme] ERROR: current_scheme not found at $TINTY_STATE" >&2 + exit 1 +fi + +SCHEME_FULL=$(cat "$TINTY_STATE" | tr -d '\n[:space:]') +if [ -z "$SCHEME_FULL" ]; then + echo "[tinty-pi-theme] ERROR: current_scheme is empty" >&2 + exit 1 +fi + +echo "[tinty-pi-theme] current scheme: $SCHEME_FULL" >&2 + +# ── Step 2 — locate the scheme YAML file ────────────────────────────────── +# scheme names: base16- or base24- +SYSTEM="${SCHEME_FULL%%-*}" # "base16" or "base24" +NAME="${SCHEME_FULL#*-}" # everything after first dash + +SCHEME_YAML="" +for dir in "$TINTY_SCHEMES/$SYSTEM" "$TINTY_CUSTOM/$SYSTEM"; do + cand="$dir/$NAME.yaml" + if [ -f "$cand" ]; then + SCHEME_YAML="$cand" + break + fi +done + +if [ -z "$SCHEME_YAML" ]; then + echo "[tinty-pi-theme] ERROR: scheme YAML not found for $SCHEME_FULL" >&2 + exit 1 +fi +echo "[tinty-pi-theme] scheme file: $SCHEME_YAML" >&2 + +# ── Step 3 — extract palette colours from YAML ──────────────────────────── +parse_yaml_value() { + local key="$1" + grep -E "^[[:space:]]*${key}:" "$SCHEME_YAML" \ + | sed -E 's/^[^:]*:[[:space:]]*"?([^"]*)"?/\1/' \ + | head -1 +} + +# Normalize: strip # prefix if present, or add it +fmt_hex() { + local v="$1" + [ -z "$v" ] && { echo ""; return; } + v="$(echo "$v" | tr -d '"' | xargs)" + if [[ "$v" == \#* ]]; then echo "$v" + else echo "#$v" + fi +} + +# Read variant (dark/light) — not currently used but useful metadata +VARIANT="$(parse_yaml_value "variant")" +[ -z "$VARIANT" ] && VARIANT="dark" + +# Extract base16 colours — stored in simple indexed variables +# Backing array approach: use positional variables via eval to avoid +# associative-array requirement on macOS bash <4. +b00="$(fmt_hex "$(parse_yaml_value "base00")")" +b01="$(fmt_hex "$(parse_yaml_value "base01")")" +b02="$(fmt_hex "$(parse_yaml_value "base02")")" +b03="$(fmt_hex "$(parse_yaml_value "base03")")" +b04="$(fmt_hex "$(parse_yaml_value "base04")")" +b05="$(fmt_hex "$(parse_yaml_value "base05")")" +b06="$(fmt_hex "$(parse_yaml_value "base06")")" +b07="$(fmt_hex "$(parse_yaml_value "base07")")" +b08="$(fmt_hex "$(parse_yaml_value "base08")")" +b09="$(fmt_hex "$(parse_yaml_value "base09")")" +b0A="$(fmt_hex "$(parse_yaml_value "base0A")")" +b0B="$(fmt_hex "$(parse_yaml_value "base0B")")" +b0C="$(fmt_hex "$(parse_yaml_value "base0C")")" +b0D="$(fmt_hex "$(parse_yaml_value "base0D")")" +b0E="$(fmt_hex "$(parse_yaml_value "base0E")")" +b0F="$(fmt_hex "$(parse_yaml_value "base0F")")" + +# Verify we got at least the critical colour (base00 / background) +if [ -z "$b00" ]; then + echo "[tinty-pi-theme] ERROR: could not parse palette from $SCHEME_YAML" >&2 + exit 1 +fi + +# Named aliases — makes the mapping block below readable +bg0="$b00" # Default Background +bg1="$b01" # Lighter Background (panels, surfaces) +bg2="$b02" # Selection Background +cmt="$b03" # Comments, Invisibles +fg3="$b04" # Dark Foreground / status text +fg0="$b05" # Default Foreground +fg1="$b06" # Light Foreground +bg3="$b07" # Light Background (light themes) + +red="$b08" # Red: variables, XML tags, diff-deleted +org="$b09" # Orange: numbers, constants, link URL +ylw="$b0A" # Yellow: classes, markup bold +grn="$b0B" # Green: strings, diff-inserted +cyn="$b0C" # Cyan: support, regexp, quotes +blu="$b0D" # Blue: functions, headings, links +pur="$b0E" # Purple: keywords, storage +brn="$b0F" # Brown: deprecated + +# ── Step 4 — build the pi theme JSON ────────────────────────────────────── +mkdir -p "$PI_THEMES" + +cat > "$PI_THEME_FILE" << THEME_EOF +{ + "\$schema": "https://raw.githubusercontent.com/earendil-works/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json", + "name": "tinted", + "version": "${SCHEME_FULL}", + "vars": { + "red": "${red}", + "orange": "${org}", + "yellow": "${ylw}", + "green": "${grn}", + "cyan": "${cyn}", + "blue": "${blu}", + "purple": "${pur}", + "brown": "${brn}", + "bg": "${bg0}", + "bgLight": "${bg1}", + "bgSelect": "${bg2}", + "comment": "${cmt}", + "fgDim": "${fg3}", + "fg": "${fg0}", + "fgLight": "${fg1}" + }, + "colors": { + "accent": "blue", + "border": "comment", + "borderAccent": "cyan", + "borderMuted": "bgSelect", + "success": "green", + "error": "red", + "warning": "yellow", + "muted": "comment", + "dim": "fgDim", + "text": "", + "thinkingText": "comment", + + "selectedBg": "bgSelect", + "userMessageBg": "bgLight", + "userMessageText": "", + "customMessageBg": "bgLight", + "customMessageText": "", + "customMessageLabel": "purple", + "toolPendingBg": "bgLight", + "toolSuccessBg": "bgLight", + "toolErrorBg": "bgLight", + "toolTitle": "", + "toolOutput": "fgDim", + + "mdHeading": "yellow", + "mdLink": "blue", + "mdLinkUrl": "orange", + "mdCode": "cyan", + "mdCodeBlock": "green", + "mdCodeBlockBorder": "comment", + "mdQuote": "comment", + "mdQuoteBorder": "cyan", + "mdHr": "comment", + "mdListBullet": "cyan", + + "toolDiffAdded": "green", + "toolDiffRemoved": "red", + "toolDiffContext": "comment", + + "syntaxComment": "comment", + "syntaxKeyword": "purple", + "syntaxFunction": "blue", + "syntaxVariable": "red", + "syntaxString": "green", + "syntaxNumber": "orange", + "syntaxType": "yellow", + "syntaxOperator": "", + "syntaxPunctuation": "", + + "thinkingOff": "comment", + "thinkingMinimal": "fgDim", + "thinkingLow": "blue", + "thinkingMedium": "cyan", + "thinkingHigh": "yellow", + "thinkingXhigh": "red", + + "bashMode": "green" + } +} +THEME_EOF + +echo "[tinty-pi-theme] wrote pi theme → $PI_THEME_FILE" >&2 +echo "[tinty-pi-theme] scheme: ${SCHEME_FULL} variant: ${VARIANT}" >&2 diff --git a/tinted-theming/.config/tinted-theming/tinty/scripts/tinty-tuicr-theme.sh b/tinted-theming/.config/tinted-theming/tinty/scripts/tinty-tuicr-theme.sh new file mode 100755 index 0000000..ee5e2d8 --- /dev/null +++ b/tinted-theming/.config/tinted-theming/tinty/scripts/tinty-tuicr-theme.sh @@ -0,0 +1,433 @@ +#!/usr/bin/env bash +# tinty-tuicr-theme.sh — Generate a tuicr local theme from the current tinty scheme +# +# Reads tinty's current-scheme state, finds the palette YAML, maps base16 +# colors to tuicr's ~42 UI colour keys, and writes +# ~/.config/tuicr/themes/tinted.toml. +# +# tuicr picks up the local theme when you run: +# tuicr --theme tinted +# or set `theme = "tinted"` in ~/.config/tuicr/config.toml. +# +# Hook into tinty config.toml: +# [[items]] +# name = "tuicr" +# path = "https://github.com/tinted-theming/base16-schemes" +# hook = "~/.config/tinted-theming/tinty/scripts/tinty-tuicr-theme.sh" +# themes-dir = "." + +set -euo pipefail + +# ── Configuration ────────────────────────────────────────────────────────── +TINTY_DATA="${TINTY_DATA:-$HOME/.local/share/tinted-theming/tinty}" +TINTY_SCHEMES="${TINTY_DATA}/repos/schemes" +TINTY_CUSTOM="${TINTY_DATA}/custom-schemes" +TINTY_STATE="${TINTY_DATA}/current_scheme" + +TUICR_THEMES="${HOME}/.config/tuicr/themes" +TUICR_TOML="${TUICR_THEMES}/tinted.toml" +TUICR_TMTHEME="${TUICR_THEMES}/tinted.tmTheme" + +# ── Helpers ──────────────────────────────────────────────────────────────── +parse_yaml_value() { + local key="$1" + grep -E "^[[:space:]]*${key}:" "$SCHEME_YAML" \ + | sed -E 's/^[^:]*:[[:space:]]*"?([^"]*)"?/\1/' \ + | head -1 +} + +fmt_hex() { + local v="$1" + [ -z "$v" ] && { echo ""; return; } + v="$(echo "$v" | tr -d '"' | xargs)" + if [[ "$v" == \#* ]]; then echo "$v" + else echo "#$v" + fi +} + +# Blend two hex colours: blend $base $accent $pct +# pct=0 → 100% base; pct=100 → 100% accent +blend() { + local base="$1" accent="$2" pct="$3" + # strip # prefix + local br bg bb ar ag ab + br=$((16#${base:1:2})) + bg=$((16#${base:3:2})) + bb=$((16#${base:5:2})) + ar=$((16#${accent:1:2})) + ag=$((16#${accent:3:2})) + ab=$((16#${accent:5:2})) + local inv=$((100 - pct)) + local r=$(( (br * inv + ar * pct) / 100 )) + local g=$(( (bg * inv + ag * pct) / 100 )) + local b=$(( (bb * inv + ab * pct) / 100 )) + printf "#%02x%02x%02x" "$r" "$g" "$b" +} + +# Determine if a hex colour is dark (avg < 128) +is_dark() { + local hex="$1" + local r g b avg + r=$((16#${hex:1:2})) + g=$((16#${hex:3:2})) + b=$((16#${hex:5:2})) + avg=$(( (r + g + b) / 3 )) + [ "$avg" -lt 128 ] +} + +# ── Step 1 — grab current scheme name from tinty state ──────────────────── +if [ ! -f "$TINTY_STATE" ]; then + echo "[tinty-tuicr] ERROR: current_scheme not found at $TINTY_STATE" >&2 + exit 1 +fi + +SCHEME_FULL=$(cat "$TINTY_STATE" | tr -d '\n[:space:]') +if [ -z "$SCHEME_FULL" ]; then + echo "[tinty-tuicr] ERROR: current_scheme is empty" >&2 + exit 1 +fi + +echo "[tinty-tuicr] current scheme: $SCHEME_FULL" >&2 + +# ── Step 2 — locate the scheme YAML file ────────────────────────────────── +SYSTEM="${SCHEME_FULL%%-*}" +NAME="${SCHEME_FULL#*-}" + +SCHEME_YAML="" +for dir in "$TINTY_SCHEMES/$SYSTEM" "$TINTY_CUSTOM/$SYSTEM"; do + cand="$dir/$NAME.yaml" + if [ -f "$cand" ]; then + SCHEME_YAML="$cand" + break + fi +done + +if [ -z "$SCHEME_YAML" ]; then + echo "[tinty-tuicr] ERROR: scheme YAML not found for $SCHEME_FULL" >&2 + exit 1 +fi +echo "[tinty-tuicr] scheme file: $SCHEME_YAML" >&2 + +# ── Step 3 — extract base16 palette ─────────────────────────────────────── +b00="$(fmt_hex "$(parse_yaml_value "base00")")" +b01="$(fmt_hex "$(parse_yaml_value "base01")")" +b02="$(fmt_hex "$(parse_yaml_value "base02")")" +b03="$(fmt_hex "$(parse_yaml_value "base03")")" +b04="$(fmt_hex "$(parse_yaml_value "base04")")" +b05="$(fmt_hex "$(parse_yaml_value "base05")")" +b06="$(fmt_hex "$(parse_yaml_value "base06")")" +b07="$(fmt_hex "$(parse_yaml_value "base07")")" +b08="$(fmt_hex "$(parse_yaml_value "base08")")" +b09="$(fmt_hex "$(parse_yaml_value "base09")")" +b0A="$(fmt_hex "$(parse_yaml_value "base0A")")" +b0B="$(fmt_hex "$(parse_yaml_value "base0B")")" +b0C="$(fmt_hex "$(parse_yaml_value "base0C")")" +b0D="$(fmt_hex "$(parse_yaml_value "base0D")")" +b0E="$(fmt_hex "$(parse_yaml_value "base0E")")" +b0F="$(fmt_hex "$(parse_yaml_value "base0F")")" + +if [ -z "$b00" ]; then + echo "[tinty-tuicr] ERROR: could not parse palette from $SCHEME_YAML" >&2 + exit 1 +fi + +# ── Step 4 — derive blended/computed colours ────────────────────────────── +# tuicr internal: blend(panel_bg, green, 20) → diff_add_bg +# blend(panel_bg, red, 20) → diff_del_bg +# blend(panel_bg, green, 16) → syntax_add_bg +# blend(panel_bg, red, 16) → syntax_del_bg +diff_add_bg="$(blend "$b00" "$b0B" 20)" +diff_del_bg="$(blend "$b00" "$b08" 20)" +syntax_add_bg="$(blend "$b00" "$b0B" 16)" +syntax_del_bg="$(blend "$b00" "$b08" 16)" + +# accent foreground for message/mode badges: +# dark panel → use base00 (dark) for fg on bright badges +# light panel → use base07 (light) for fg on bright badges +if is_dark "$b00"; then + accent_fg="$b00" +else + accent_fg="$b07" +fi + +# Variant for mode/message badges: dark bg → light-ish accent text +if is_dark "$b00"; then + mode_accent_fg="$b00" +else + mode_accent_fg="$b07" +fi + +# ── Step 5 — write tuicr UI theme TOML + syntax .tmTheme ──────────────── +mkdir -p "$TUICR_THEMES" + +cat > "$TUICR_TOML" << TUICR_EOF +# tuicr local theme generated by tinty-tuicr-theme.sh +# Scheme: ${SCHEME_FULL} + +# Base colours +panel_bg = "${b00}" +bg_highlight = "${b01}" +fg_primary = "${b05}" +fg_secondary = "${b04}" +fg_dim = "${b03}" + +# Diff colours +diff_add = "${b0B}" +diff_add_bg = "${diff_add_bg}" +diff_del = "${b08}" +diff_del_bg = "${diff_del_bg}" +diff_context = "${b05}" +diff_hunk_header = "${b0D}" +expanded_context_fg = "${b03}" + +# Syntax highlight diff backgrounds +syntax_add_bg = "${syntax_add_bg}" +syntax_del_bg = "${syntax_del_bg}" + +# Syntax theme (TextMate .tmTheme for code highlighting inside diffs) +syntax_theme = "tinted.tmTheme" + +# File status +file_added = "${b0B}" +file_modified = "${b0A}" +file_deleted = "${b08}" +file_renamed = "${b0E}" + +# Review status +reviewed = "${b0B}" +pending = "${b0A}" + +# Comment types +comment_note = "${b0D}" +comment_suggestion = "${b0C}" +comment_issue = "${b08}" +comment_praise = "${b0B}" + +# UI elements +border_focused = "${b0C}" +border_unfocused = "${b02}" +status_bar_bg = "${b01}" +cursor_color = "${b09}" +cursor_line_bg = "${b01}" +branch_name = "${b0C}" +help_indicator = "${b03}" + +# Message badges +message_info_fg = "${accent_fg}" +message_info_bg = "${b0D}" +message_warning_fg = "${accent_fg}" +message_warning_bg = "${b0A}" +message_error_fg = "${accent_fg}" +message_error_bg = "${b08}" + +# Update badge +update_badge_fg = "${accent_fg}" +update_badge_bg = "${b09}" + +# Mode indicator +mode_fg = "${mode_accent_fg}" +mode_bg = "${b0D}" +TUICR_EOF + +# ── Step 6 — write syntax .tmTheme ─────────────────────────────────────── +# Standard base16 mapping for TextMate scopes +cat > "$TUICR_TMTHEME" << TM_EOF + + + + + name + tinted (${SCHEME_FULL}) + uuid + $(uuidgen) + settings + + + settings + + foreground + ${b05} + background + ${b00} + caret + ${b05} + selection + ${b02} + lineHighlight + ${b01} + invisibles + ${b03} + gutter + ${b03} + gutterForeground + ${b04} + + + + name + Comment + scope + comment, punctuation.definition.comment + settings + + foreground + ${b03} + fontStyle + italic + + + + name + Keyword + scope + keyword, storage, storage.type, storage.modifier + settings + + foreground + ${b0E} + + + + name + String + scope + string, string constant.character.escape, punctuation.definition.string + settings + + foreground + ${b0B} + + + + name + Constant + scope + constant, constant.numeric, constant.language, constant.character + settings + + foreground + ${b09} + + + + name + Function / Type + scope + entity.name.function, support.function, entity.name.type, support.type + settings + + foreground + ${b0D} + + + + name + Variable + scope + variable, variable.parameter, variable.other, support.variable + settings + + foreground + ${b05} + + + + name + Support / Regex / Escape + scope + support, support.class, support.constant, entity.name.tag, meta.tag, punctuation.definition.tag, punctuation.separator.key-value, keyword.operator, constant.other.symbol + settings + + foreground + ${b0C} + + + + name + Class / Markup Bold + scope + entity.name.class, entity.name.module, markup.bold + settings + + foreground + ${b0A} + fontStyle + bold + + + + name + Tag / Attribute + scope + entity.name.tag, entity.other.attribute-name, markup.heading + settings + + foreground + ${b08} + + + + name + Deprecated + scope + invalid.deprecated + settings + + foreground + ${b0F} + + + + name + Invalid + scope + invalid, invalid.illegal + settings + + foreground + ${b00} + background + ${b08} + + + + name + Diff Inserted + scope + markup.inserted, markup.inserted.diff + settings + + foreground + ${b0B} + + + + name + Diff Deleted + scope + markup.deleted, markup.deleted.diff + settings + + foreground + ${b08} + + + + name + Diff Changed + scope + markup.changed, markup.changed.diff + settings + + foreground + ${b0E} + + + + + +TM_EOF + +echo "[tinty-tuicr] wrote tuicr theme → $TUICR_TOML" >&2 +echo "[tinty-tuicr] wrote syntax theme → $TUICR_TMTHEME" >&2 +echo "[tinty-tuicr] scheme: ${SCHEME_FULL}" >&2