color
3.0.0, released 6 years ago by mikefenwick.com
Create, convert, alter, and compare colors in various colorspaces.
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.
- dynamic_color
Create Material color schemes based on a platform's implementation of dynamic color.
83Compare - dynamic_system_colors
Create Material color schemes based on the platform's dynamic color implementation.
69Compare - hexcolor
Add hex color codes and convert material colors to hex in Dart and Flutter.
60Compare - derived_colors
Generate color variants and modifications for Flutter applications.
50Compare
Works with
Packages commonly used together with color: ones it builds on, ones built on it, and its own family.