Skip to content
pubscout

color

3.0.0, released 6 years ago by mikefenwick.com

Create, convert, alter, and compare colors in various colorspaces.

WASM-ready
$ flutter pub add color
Source repository

What it does

Exposes a Color class and subclasses like RgbColor, HexColor, HslColor, HsvColor, XyzColor, and CielabColor. Allows converting between colorspaces, applying color filters, and comparing color values.

AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to manipulate and convert between different color spaces (RGB, HSL, HSV, XYZ, CIELAB).
  • You want immutable color objects with const constructors.
  • You need to output CSS-compatible color strings.

Skip it when

  • You only need basic Flutter material colors which are already built into the framework.

Strengths

  • Supports multiple color spaces and bidirectional conversions.
  • Immutable colors with const constructors.
  • Includes color filters for greyscale, sepia, lightening, darkening, and inversion.

Weaknesses

  • Alternative color packages might be preferred depending on specific graphics needs.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:color/color.dart';

RgbColor rgb = const RgbColor(192, 255, 238);
HslColor hsl = rgb.toHslColor();
print(rgb.toCssString());

Alternatives

Packages that do the same job and could replace color.

Works with

Packages commonly used together with color: ones it builds on, ones built on it, and its own family.