Skip to content
pubscout

color_hash

1.0.1, released 3 years ago by alekangelov.com

Generate persistent colors from strings in Flutter.

WASM-ready
$ flutter pub add color_hash
Source repository

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.