Skip to main content
Version: 1.5

Dank16

██████╗  █████╗ ███╗   ██╗██╗  ██╗ ██╗ ██████╗
██╔══██╗██╔══██╗████╗  ██║██║ ██╔╝███║██╔════╝
██║  ██║███████║██╔██╗ ██║█████╔╝ ╚██║███████╗
██║  ██║██╔══██║██║╚██╗██║██╔═██╗  ██║██╔═══██╗
██████╔╝██║  ██║██║ ╚████║██║  ██╗ ██║╚██████╔╝
╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═══╝╚═╝  ╚═╝ ╚═╝ ╚═════╝

The dms dank16 command generates complete Base16 color palettes from a single input color. It creates harmonious 16-color terminal themes with proper contrast ratios for both light and dark modes.

Overview

Dank16 takes a single hex color and generates a full Base16-compatible palette suitable for terminals, editors, and other applications. The algorithm intelligently derives complementary colors while ensuring all colors meet contrast requirements for readability.

Key Features:

Dank16 color palette example showing 16 ANSI colorsDank16 color palette example showing 16 ANSI colors

Quick Start

Generate a dark theme palette:

dms dank16 "#8b5cf6"

Output:

palette = 0=#1a1a1a
palette = 1=#e25443
palette = 2=#6ed675
palette = 3=#dbd97b
palette = 4=#9a65fd
palette = 5=#9173d2
palette = 6=#9565ff
palette = 7=#abb2bf
palette = 8=#5c6370
palette = 9=#e06a5f
palette = 10=#86e08b
palette = 11=#e8e697
palette = 12=#e5c7ff
palette = 13=#8269d9
palette = 14=#9069c0
palette = 15=#ffffff

Generate a light theme palette:

dms dank16 "#8b5cf6" --light

Base16 Color Mapping

The generated palette follows the standard Base16 specification:

IndexPurposeDark ThemeLight Theme0BackgroundDark grayLight gray1RedSaturated redDark red2GreenSaturated greenDark green3YellowSaturated yellowDark yellow4BlueDerived from inputDerived from input5MagentaDerived from inputDerived from input6CyanDerived from inputDerived from input7ForegroundLight grayDark gray8Bright BlackMedium grayDark gray9Bright RedLighter redMedium red10Bright GreenLighter greenMedium green11Bright YellowLighter yellowMedium yellow12Bright BlueLighter variantLighter variant13Bright MagentaLighter variantLighter variant14Bright CyanLighter variantLighter variant15Bright WhiteWhiteBlack

Output Formats

Default Format

The default output is a simple palette format:

dms dank16 "#8b5cf6"

Kitty Terminal

dms dank16 "#8b5cf6" --kitty

Output:

color0 #1a1a1a
color1 #e25443
color2 #6ed675
color3 #dbd97b
...

Copy the output directly to your ~/.config/kitty/kitty.conf.

Foot Terminal

dms dank16 "#8b5cf6" --foot

Generates color configuration for the Foot terminal emulator.

Alacritty Terminal

dms dank16 "#8b5cf6" --alacritty

Generates YAML configuration for Alacritty's color scheme.

Ghostty Terminal

dms dank16 "#8b5cf6" --ghostty

Generates configuration for the Ghostty terminal emulator.

JSON Format

dms dank16 "#8b5cf6" --json

Outputs the palette as a JSON object with detailed color information.

Variants Format

dms dank16 "#8b5cf6" --variants [--light] [--background <color>]

Outputs all color variants in a single call:

{
"color0": {
"dark": { "hex": "#1a1a1a", "hex_stripped": "1a1a1a" },
"light": { "hex": "#f8f8f8", "hex_stripped": "f8f8f8" },
"default": { "hex": "#1a1a1a", "hex_stripped": "1a1a1a" }
},
...
}
VariantDescriptiondarkAlways dark mode colorslightAlways light mode colorsdefaultMode-aware (uses --light flag to determine which variant)

Use --primary-dark and --primary-light to specify different primary colors for each mode:

dms dank16 --variants --primary-dark "#8b5cf6" --primary-light "#6d28d9"

This is the format injected into matugen templates as the dank16 object.

Contrast Algorithms

Dank16 supports two contrast algorithms to ensure readability:

Delta Phi Star (DPS) - Default

The default algorithm uses Delta Phi Star contrast, which provides perceptually uniform contrast based on the golden ratio (phi). This algorithm:

dms dank16 "#8b5cf6" --contrast dps

How it works:

  1. Converts colors to CIELAB space (L*, a*, b*)
  2. Calculates lightness contrast using: Lc = (|Lb^φ - Lf^φ|)^(1/φ) × 1.414 - 40
  3. Adjusts for polarity (+5 for dark mode)
  4. Ensures minimum contrast thresholds are met

WCAG Contrast

Uses the standard WCAG 2.1 contrast ratio algorithm:

dms dank16 "#8b5cf6" --contrast wcag

Advanced Options

Custom Background

Specify a custom background color instead of the default:

# Dark theme with custom background
dms dank16 "#8b5cf6" --background "#0d1117"

# Light theme with custom background
dms dank16 "#8b5cf6" --light --background "#ffffff"

Combining Options

All options can be combined:

dms dank16 "#8b5cf6" \
--light \
--background "#fafafa" \
--contrast wcag \
--kitty > ~/.config/kitty/dank-light.conf

Algorithm Overview

The palette generation process follows these steps:

  1. Container Derivation: Derives a container color from the input by adjusting saturation and value based on theme mode

  2. Color Generation: Creates the core palette colors:

  3. Contrast Enforcement: Each color is adjusted to meet minimum contrast requirements:

  4. Bright Variants: Generates brighter versions for colors 9-14:

Use Cases

Terminal Theming

Generate consistent color schemes for your terminal:

# Kitty
dms dank16 "#your-color" --kitty >> ~/.config/kitty/kitty.conf

# Foot
dms dank16 "#your-color" --foot >> ~/.config/foot/foot.ini

# Alacritty
dms dank16 "#your-color" --alacritty >> ~/.config/alacritty/alacritty.yml

Editor Themes

VSCode and other editors get their terminal colors automatically through DMS's built-in theming. The dank16 palette is also available in your custom matugen templates via the dank16 object—see the Application Theming docs for details.

Dynamic Theming

Generate themes based on wallpaper colors or system accents:

#!/bin/bash
# Extract dominant color from wallpaper
dominant_color=$(your-color-extraction-tool ~/wallpaper.jpg)

# Generate and apply terminal theme
dms dank16 "$dominant_color" --kitty > ~/.config/kitty/auto-theme.conf
kitty @ set-colors -a ~/.config/kitty/auto-theme.conf

Light/Dark Mode Automation

Create matching light and dark variants:

#!/bin/bash
COLOR="#8b5cf6"

# Generate both variants
dms dank16 "$COLOR" --kitty > ~/.config/kitty/dank-dark.conf
dms dank16 "$COLOR" --light --kitty > ~/.config/kitty/dank-light.conf

# Switch based on time or system setting
if is_dark_mode; then
kitty @ set-colors -a ~/.config/kitty/dank-dark.conf
else
kitty @ set-colors -a ~/.config/kitty/dank-light.conf
fi

Tips & Best Practices

Choosing Input Colors

Choose an input color that you want to be prominent in your terminal. The input color will be most directly represented as the blue/cyan colors (palette indices 4, 6, 12, 14) in the output, with other colors derived as complementary hues. True red, green, and yellow will still be represented in the appropriate position.

Testing Contrast

After generating a palette, test it with actual terminal applications:

# Generate palette
dms dank16 "#8b5cf6" --kitty > /tmp/test-theme.conf

# Open new kitty window with theme
kitty -o include=/tmp/test-theme.conf

Iterating on Themes

Try slight variations of your input color to find the perfect palette:

# Try different shades
dms dank16 "#8b5cf6" # Original
dms dank16 "#9b6cf6" # Slightly lighter
dms dank16 "#7b4ce6" # Slightly darker

Command Reference

dms dank16 <hex_color> [flags]

Arguments:

Flags: