or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

background-colors.mdindex.mdspecial-effects.mdtext-colors.mdtext-styles.mdutility-functions.md
tile.json

special-effects.mddocs/

Special Effects

Advanced text transformation effects including rainbow colors, zalgo text, themed patterns, and custom character transformations.

Capabilities

Color Pattern Effects

Multi-color effects that apply different colors to individual characters in sequence.

/**
 * Apply rainbow color cycling effect (red, yellow, green, blue, magenta pattern)
 * @param str - Text to apply rainbow colors to
 * @returns Text with rainbow color pattern
 */
function rainbow(str: string): string;

/**
 * Apply alternating inverse styling effect (zebra stripe pattern)
 * @param str - Text to apply zebra pattern to
 * @returns Text with alternating inverse characters
 */
function zebra(str: string): string;

/**
 * Apply American flag color pattern (red, white, blue cycling)
 * @param str - Text to apply America colors to
 * @returns Text with red/white/blue color pattern
 */
function america(str: string): string;

/**
 * Apply random colors and styles to each character
 * @param str - Text to apply random styling to
 * @returns Text with randomly colored and styled characters
 */
function random(str: string): string;

Character Transformation Effects

Advanced text effects that modify the actual characters or add combining characters.

/**
 * Apply "trap" character transformation using Unicode substitution
 * @param str - Text to transform (defaults to "Run the trap, drop the bass" if not provided)
 * @param options - Transformation options (currently unused)
 * @returns Text with characters replaced by trap-style Unicode variants
 */
function trap(str?: string, options?: any): string;

/**
 * Apply zalgo text effect with combining characters for chaotic appearance
 * @param str - Text to transform (defaults to "   he is here   " if not provided)
 * @param options - Zalgo transformation options
 * @returns Text with combining characters creating distorted appearance
 */
function zalgo(str?: string, options?: ZalgoOptions): string;

Types

interface ZalgoOptions {
  /** Add combining characters above text (default: true) */
  up?: boolean;
  /** Add combining characters in middle of text (default: true) */
  mid?: boolean;
  /** Add combining characters below text (default: true) */
  down?: boolean;
  /** Intensity of effect: 'mini', 'maxi', or other values (default: 'maxi') */
  size?: 'mini' | 'maxi' | string;
}

Usage Examples

Color Pattern Effects:

const colors = require('colors/safe');

console.log(colors.rainbow('Rainbow text with cycling colors'));
console.log(colors.zebra('Alternating inverse pattern'));
console.log(colors.america('Red white and blue pattern'));
console.log(colors.random('Every character different colors'));

Character Transformation Effects:

const colors = require('colors/safe');

console.log(colors.trap('Transform to trap style'));
console.log(colors.zalgo('Distorted zalgo text'));

// Custom zalgo options
console.log(colors.zalgo('Custom zalgo', {
  up: true,
  mid: false,
  down: true,
  size: 'mini'
}));

String Prototype API:

const colors = require('colors');

console.log('Rainbow colors!'.rainbow);
console.log('Zebra stripes!'.zebra);
console.log('USA colors!'.america);
console.log('Random styling!'.random);
console.log('Trap transformation!'.trap);
console.log('Zalgo effect!'.zalgo);

Combining with other effects:

const colors = require('colors/safe');

// Apply rainbow to already bold text
console.log(colors.rainbow(colors.bold('Bold rainbow text')));

// Apply trap transformation then color it
console.log(colors.red(colors.trap('Red trap text')));

// Complex combinations
console.log(colors.underline.rainbow('Underlined rainbow text'));

Effect Descriptions

  • Rainbow: Cycles through red, yellow, green, blue, magenta colors character by character
  • Zebra: Alternates between normal and inverse styling every other character
  • America: Cycles through red, white, blue colors in sequence for patriotic effect
  • Random: Applies random colors and styles from a predefined set including underline, inverse, grey, yellow, red, green, blue, white, cyan, magenta, and bright variants
  • Trap: Replaces standard Latin characters with visually similar Unicode characters for stylistic effect
  • Zalgo: Adds combining characters above, below, and through text to create a chaotic, "corrupted" appearance

String Prototype Extensions

When using the default import, all special effect functions are available as getters on String.prototype:

interface String {
  rainbow: string;
  zebra: string;
  america: string;
  random: string;
  trap: string;
  zalgo: string;
}