micronoise

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BrightnessLevels = []float64{
	0.25,
	0.40,
	0.55,
	0.70,
	0.85,
	1.00,
	1.15,
	1.30,
}

BrightnessLevels defines the 8 brightness multipliers for the gradient. Goes from dark (left) to bright (right), creating a "marquee" effect. Values < 1.0 = darker, values > 1.0 = brighter

View Source
var StateConfigs = map[string]FlickerConfig{
	"think":     {Enabled: true},
	"read":      {Enabled: true},
	"write":     {Enabled: true},
	"search":    {Enabled: true},
	"websearch": {Enabled: true},
	"webfetch":  {Enabled: true},
	"arise":     {Enabled: true},
	"approval":  {Enabled: true},
}

StateConfigs maps state names to their flicker configuration. States not in this map will have no flicker effect.

Functions

func ApplyColorWave

func ApplyColorWave(lines []string, width, height int, frameCounter int, cfg *FlickerConfig) []string

ApplyColorWave redirects to ApplyShiftingGradient

func ApplyNoise

func ApplyNoise(lines []string, width, height int, slots []int, activeCount int) []string

ApplyNoise is deprecated, kept for compatibility

func ApplyRandomFlicker

func ApplyRandomFlicker(lines []string, width, height int, cfg *FlickerConfig) []string

ApplyRandomFlicker redirects to ApplyShiftingGradient

func ApplyShiftingGradient

func ApplyShiftingGradient(lines []string, width, height int, frameCounter int, cfg *FlickerConfig) []string

ApplyShiftingGradient applies a dark-to-light gradient that shifts left each frame. Creates a "marquee" / "Wall Street ticker" effect where brightness sweeps across.

Parameters:

  • lines: The avatar lines (ANSI colorized)
  • width, height: Avatar dimensions
  • frameCounter: Current frame number (controls gradient shift)
  • cfg: Flicker configuration for the current state

Each column has a brightness level from BrightnessLevels. Every frame, the pattern shifts left by 1 position (wrapping around).

func HexToRGB

func HexToRGB(hex string) (int, int, int)

HexToRGB converts hex color string to RGB values.

Types

type FlickerConfig

type FlickerConfig struct {
	Enabled bool // Whether flicker is active for this state
}

FlickerConfig defines color flicker behavior for micro avatars

func GetConfig

func GetConfig(stateName string) *FlickerConfig

GetConfig returns the flicker config for a state, or nil if no flicker effect.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL