Skip to content
pubscout

prism

2.1.0, released a year ago by rocketware.co.uk

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

WASM-ready
$ flutter pub add prism
Source repository

What it does

Prism provides a color manipulation library supporting multiple color models (RGB, HSL, Oklab, Oklch), accessibility tools, and pre-built palettes. It allows developers to parse color strings, convert between models, adjust properties like lightness and chroma, and integrate directly with Flutter's Color class.

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

Use it when

  • You need to convert colors between different color models like RGB, HSL, Oklab, and Oklch.
  • You want a zero-dependency color library optimized for Dart and Flutter.
  • You need access to pre-built color palettes such as Material, CSS, Rainbow, and OpenColor.

Skip it when

  • You are looking for a complete UI component kit or full design system.
  • You require backend database or network state management.

Strengths

  • Zero dependencies with high performance bit operations.
  • Multiple color models with seamless conversion and perceptually uniform color spaces.
  • Extensive pre-built color palettes and accessibility schemes.

Weaknesses

  • RayRgb16 uses component arrays instead of bit operations on web due to JavaScript lacking 64-bit integer support.

Setup

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

final red = Ray.parse('#FF0000');
final darkRed = red.toOklch().withLightness(0.3);
print(darkRed.toRgb8().toHex());

Alternatives

Packages that do the same job and could replace prism.

Works with

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