prism
2.1.0, released a year ago by rocketware.co.uk
An optimized, zero-dependency color manipulation library for Dart and Flutter.
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.
- tinycolor2
Flutter color manipulation and conversion library ported from JS tinycolor2
50Compare - material_color_generator
Generates a MaterialColor palette from a single HEX color.
47Compare - derived_colors
Generate color variants and modifications for Flutter applications.
50Compare - color_palette_plus
Generates color palettes, shades, and Material Design themes in Flutter.
46Compare
Works with
Packages commonly used together with prism: ones it builds on, ones built on it, and its own family.