Overview
ThergbDefaults object defines the default configuration for gradient text generation. It contains all settings for colors, formatting, output formats, and gradient behavior.
rgbDefaults
Default configuration object for gradient generation.Properties
Configuration version number
Array of color stops defining the gradient.
hex: Hex color string (e.g., ‘#FF5733’)pos: Position in gradient (0-100)
Optional shadow color stops for MiniMessage format. If null, auto-generates shadows at 25% brightness of main colors.
Number of characters per color segment. Higher values = fewer color changes.
The text to apply the gradient to
Output format template. See Format Templates below.
Wrapper template with
$t placeholder for the full output. Applied after all other formatting.Whether using a custom format template
Skip gradient for whitespace-only segments (preserves spacing)
Auto-distribute colors evenly (overrides pos values)
Convert output to lowercase
Apply bold formatting
Apply italic formatting
Apply underline formatting
Apply strikethrough formatting
Apply obfuscated/magic text formatting (Minecraft)
Gradient interpolation type: ‘rgb’, ‘hsl’, ‘oklab’, ‘oklch’, ‘cielab’, or ‘luvLch’. See Gradient Types.
format Interface
Defines the output format template structure.Color format template using placeholders:
$1through$6: Individual hex digits$f: Format codes (bold, italic, etc.)$c: The character/text segment- Special values: ‘MiniMessage’, ‘JSON’
Format character for Minecraft-style codes (e.g., ’&’ or ’§’)
CSS class for web output (future use)
Bold wrapper template with
$t placeholderItalic wrapper template with
$t placeholderUnderline wrapper template with
$t placeholderStrikethrough wrapper template with
$t placeholderObfuscate wrapper template with
$t placeholderFormat Templates
Pre-defined format templates in theformats array:
MiniMessage (index 0)
<gradient:#color1:#color2>text</gradient>
Bukkit/Spigot Ampersand (index 1, default)
&#F&#F<ext (if bold)
JSON (index 2)
Section Sign (index 3)
CMI/Essentials Ampersand (index 4)
DeluxeMenus/AdvancedBan (index 5)
BBCode (index 6)
Usage Examples
Basic Configuration
MiniMessage Format
Custom Format
With Prefix/Suffix
Multi-Color with Custom Positions
Longer Color Segments
Utility Functions
disperseColors
Auto-distributes colors evenly across the gradient.Input color array (pos values are ignored)
Colors with evenly distributed positions
Example
sortColors
Sorts colors by position.swapItems
Swaps two items in an array, maintaining pos values if present.Array to swap items in
First index (supports negative wrapping)
Second index (supports negative wrapping)
New array with swapped items
getShadowColors
Generates shadow colors for the gradient (auto-darkens or uses custom).Related
- Generate Output - Use these options to generate text
- Gradient Types - Gradient interpolation types
- Color Utilities - Color conversion functions
Implementation
Source:packages/rgbirdflop/src/util/Defaults.ts:58