Documentation
¶
Index ¶
- func ColorizeLine(line string, p Palette, intensity float64, rng *rand.Rand) string
- func ColorizeRune(s string, p Palette, intensity float64, charIndex int, rng *rand.Rand) string
- func ListPalettes() []string
- func TransformLine(line string, intensity float64, maxMarks int, rng *rand.Rand) string
- func TransformRune(r rune, intensity float64, maxMarks int, rng *rand.Rand) string
- type Descent
- type Palette
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorizeLine ¶
ColorizeLine applies palette colors to each grapheme cluster in a line. Clusters with combining marks are colored at full intensity. Unaffected clusters get a reduced probability so color bleeds into surrounding text.
func ColorizeRune ¶
ColorizeRune wraps a single rune string with a color from the palette. intensity controls how likely a character is to get colored (0 = never, 1 = always). charIndex provides variation across characters in a line.
func TransformLine ¶
TransformLine applies zalgo to every rune in a line.
func TransformRune ¶
TransformRune applies zalgo combining characters to a single rune. intensity is 0.0 (no effect) to 1.0 (full effect). Returns the rune as a string with combining characters appended. TransformRune applies zalgo combining characters to a single rune. intensity is 0.0 (no effect) to 1.0 (full effect). Returns the rune as a string with combining characters appended.
Types ¶
type Descent ¶
Descent defines the line range over which zalgo intensity ramps from 0 to 1.
func DefaultDescent ¶
func DefaultDescent() Descent
DefaultDescent returns the default descent range (lines 20-200).
func ParseDescent ¶
ParseDescent parses a "start:end" string into a Descent.