Skip to content
pubscout

hsluv

1.3.0, released 4 days ago by an unverified publisher

Dart/Flutter library for converting colors using the perceptually uniform HSLuv and HPLuv spaces.

WASM-ready
$ flutter pub add hsluv
Source repository

What it does

Provides functions and high‑level classes to convert between RGB, HSLuv, HPLuv, LCH, LUV, XYZ and hex representations. Includes a Color extension for easy use with Flutter's Color type.

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

Use it when

  • You need perceptually uniform color manipulation in a Flutter app
  • You want to generate accessible color palettes based on human‑friendly color spaces

Skip it when

  • You only need basic RGB/HSV conversions and want a smaller dependency
  • You require a full UI color picker library

Strengths

  • Accurate reference implementation with extensive conversion functions
  • Works directly with dart:ui Color, no extra dependencies
  • Supports both low‑level list APIs and high‑level Color extensions

Weaknesses

  • Only color conversion, no UI components for picking colors
  • Adds a dependency on Flutter even for pure Dart use

Setup

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

void main(){
  final hsluv = HSLuvColor.fromHSL(300,70,60);
  print(hsluv.toString());
  final rgb = Hsluv.hsluvToRgb([300,70,60]);
  print(rgb);
}

Alternatives

Packages that do the same job and could replace hsluv.

  • yaml

    A Dart library for parsing YAML documents into Dart data structures.

  • zxcvbn

    Dart port of Dropbox's zxcvbn password strength estimator library.

  • shortid

    Generates short, non‑sequential, URL‑friendly unique strings.

  • humanize

    Humanize provides locale‑aware helpers to format dates, numbers, lists and file sizes for UI strings.