color_hash
1.0.1, released 3 years ago by alekangelov.com
Generate persistent colors from strings in Flutter.
WASM-ready
What it does
Generates consistent and persistent color values based on a given string input. Allows customization of saturation, lightness, and hue ranges through a factory.
AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to assign consistent avatar colors or badges based on user names or IDs
- You want deterministic color generation from arbitrary strings
Skip it when
- You need a comprehensive color palette generation algorithm beyond string hashing
Strengths
- Simple API with factory creation options
- Persistent color generation based on string hashing
Weaknesses
- Limited feature set beyond basic string-to-color hashing
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
ColorHash colorHash = ColorHash("input");
Color color = colorHash.toColor();Alternatives
Packages that do the same job and could replace color_hash.
- material_color_utilities
Algorithms and utilities for the Material Design 3 color system.
86Compare - flutter_randomcolor
Generate attractive, customizable random colors and Flutter Color objects.
55Compare - from_css_color
Creates Flutter Color instances from CSS color strings according to CSS Color Module Level 3.
50Compare - material_color_generator
Generates a MaterialColor palette from a single HEX color.
47Compare