Skip to content
pubscout

tinycolor2

3.0.1, released 4 years ago by tinycommunity.dev

Flutter color manipulation and conversion library ported from JS tinycolor2

WASM-ready
$ flutter pub add tinycolor2
Source repository

What it does

Provides utilities to manipulate, convert, analyze, and combine colors in Flutter. It supports operations like lightening, darkening, desaturating, spinning hue, mixing colors, and querying brightness or luminance.

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

Use it when

  • You need programmatic color manipulation like lightening, darkening, or mixing in your app.
  • You want to extend the native Flutter Color class with helper methods for color adjustments.

Skip it when

  • You only need basic color constants and built-in Flutter Color and HSLColor features without helper chains.
  • You are looking for a complete UI theme design system framework.

Strengths

  • Provides a rich chaining API for color modifications.
  • Extends native Flutter Color classes for cleaner syntax.

Weaknesses

  • Limited to color manipulation and conversion utilities.
  • Relies on external packages like pigment for string parsing.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:tinycolor2/tinycolor2.dart';

final TinyColor tinyColor = TinyColor.fromColor(Colors.green);
final Color newColor = Colors.red.lighten().desaturate();

Alternatives

Packages that do the same job and could replace tinycolor2.

  • prism

    An optimized, zero-dependency color manipulation library for Dart and Flutter.

  • derived_colors

    Generate color variants and modifications for Flutter applications.

Works with

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