Styling & Themes
Tachikoma provides a comprehensive styling system with ANSI 256 colors, true RGB colors, text attributes, and a theme engine with 11 built-in palettes.
Style
Style controls how text and backgrounds appear:
Style(; fg=NoColor(), bg=NoColor(), bold=false, dim=false,
italic=false, underline=false)# Explicit style
s = Style(fg=Color256(196), bg=Color256(0), bold=false, italic=true)
# Theme-aware style (preferred)
s = tstyle(:primary, bold=true)
Color Types
Color256
ANSI 256-color palette (0–255):
Color256(196) # bright red
Color256(46) # green
Color256(0) # black
Color256(255) # white
ColorRGB
True 24-bit RGB color:
ColorRGB(255, 100, 50) # orange
ColorRGB(0x1a, 0x1b, 0x2e) # dark blue
NoColor
Transparent / terminal default:
NoColor() # inherits terminal defaultTheme-Aware Styles with tstyle
The tstyle function creates styles from the current theme's color fields:
tstyle(:primary) # theme's primary color as fg
tstyle(:primary, bold=true) # primary fg, bold
tstyle(:accent, dim=true) # accent fg, dimmed
tstyle(:error, underline=true) # error fg, underlined
Available theme fields:
| Field | Usage |
|---|---|
:border | Normal border color |
:border_focus | Focused border color |
:text | Standard text |
:text_dim | Subdued text |
:text_bright | Emphasized text |
:primary | Primary accent |
:secondary | Secondary accent |
:accent | Highlight / interactive elements |
:success | Success indicators |
:warning | Warning indicators |
:error | Error indicators |
:title | Title text |
Always prefer tstyle over hardcoded colors — your app automatically adapts when the user switches themes.
Themes
Tachikoma ships with 11 built-in themes:
| Theme | Constant | Description |
|---|---|---|
| Kokaku | KOKAKU | Deep teal cyberpunk (default) |
| Esper | ESPER | Cool blue noir |
| Motoko | MOTOKO | Warm purple cyborg |
| Kaneda | KANEDA | Hot red/orange Neo-Tokyo |
| Neuromancer | NEUROMANCER | Green-on-dark hacker |
| Catppuccin | CATPPUCCIN | Warm pastel |
| Solarized | SOLARIZED | Ethan Schoonover's palette |
| Dracula | DRACULA | Dark purple classic |
| Outrun | OUTRUN | Neon synthwave |
| Zenburn | ZENBURN | Low-contrast warm |
| Iceberg | ICEBERG | Cool blue minimal |
Theme API
theme() # get current Theme
set_theme!(KANEDA) # set by Theme value
set_theme!(:kaneda) # set by Symbol name
ALL_THEMES # tuple of all 11 themesTheme changes take effect immediately — the next view call uses the new colors.
Theme Struct
Each Theme contains:
struct Theme
name::String
border::Color256
border_focus::Color256
text::Color256
text_dim::Color256
text_bright::Color256
primary::Color256
secondary::Color256
accent::Color256
success::Color256
warning::Color256
error::Color256
title::Color256
end
Color Utilities
Interpolation and Manipulation
color_lerp(a::ColorRGB, b::ColorRGB, t) # interpolate, t ∈ [0,1]
to_rgb(c::Color256) → ColorRGB # convert palette → RGB
brighten(c::ColorRGB, amount) → ColorRGB # brighten by 0–1
dim_color(c::ColorRGB, amount) → ColorRGB # dim by 0–1
hue_shift(c::ColorRGB, degrees) → ColorRGB # rotate hue
desaturate(c::ColorRGB, amount) → ColorRGB # reduce saturationAnimated Color
# Smooth color cycling (see Animation section)
color_wave(tick, x, colors; speed=0.04, spread=0.08) → ColorRGB
Render Backends
Tachikoma supports three rendering backends that affect how canvases and visual effects are drawn:
@enum RenderBackend braille_backend block_backend sixel_backend
render_backend() # get current
set_render_backend!(braille_backend) # set + save
cycle_render_backend!(1) # cycle forward
cycle_render_backend!(-1) # cycle backward| Backend | Resolution | Description |
|---|---|---|
braille_backend | 2×4 per cell | Unicode braille dots, works everywhere |
block_backend | 2×2 per cell | Quadrant block characters, gap-free |
sixel_backend | ~16×32 per cell | Pixel-perfect raster, Kitty or sixel |
Decay Parameters
The decay system adds a "bit-rot" aesthetic — noise, jitter, and corruption effects:
mutable struct DecayParams
decay::Float64 # 0–1 master intensity
jitter::Float64 # 0–1 RGB noise
rot_prob::Float64 # 0–1 corruption probability
noise_scale::Float64 # spatial noise scale
end
decay_params() → DecayParams # get current (mutable)Adjust via the settings overlay (Ctrl+S) or programmatically. Values are saved via Preferences.jl.
Box Styles
Four border box styles for Block:
BOX_ROUNDED # ╭─╮╰─╯ (default)
BOX_HEAVY # ┏━┓┗━┛
BOX_DOUBLE # ╔═╗╚═╝
BOX_PLAIN # ┌─┐└─┘Block(title="Panel", box=BOX_HEAVY)Visual Constants
DOT = '·' # separator dot
BARS_V = ('▁','▂','▃','▄','▅','▆','▇','█') # vertical bar chars
BARS_H = ('▏','▎','▍','▌','▋','▊','▉','█') # horizontal bar chars
BLOCKS = ('█','▓','▒','░') # density blocks
SCANLINE = '╌' # interlace separator
MARKER = '▸' # list selection marker
SPINNER_BRAILLE = ['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏']
SPINNER_DOTS = ['⣾','⣽','⣻','⢿','⡿','⣟','⣯','⣷']