Skip to content
pubscout

colornames

0.2.0, released 2 years ago by thexaib.com

Get a descriptive name for any given Color using hardcoded color values and closest match.

WASM-readyCopyleft license
$ flutter pub add colornames
Source repository

What it does

Provides hardcoded names for 2231 color values and finds the closest matching name for any input color. It can be used via a static method or extension methods on `Color` and `int` types.

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

Use it when

  • You need to display human-readable names for arbitrary colors in your app.
  • You want a quick extension method on Color or int to find color names.

Skip it when

  • You require customizable or localized color name dictionaries.
  • You need advanced color space conversions beyond finding the closest hardcoded name.

Strengths

  • Includes a large built-in database of over 2200 color values.
  • Convenient extension methods for `Color` and `int` objects.

Weaknesses

  • Limited to hardcoded names without dynamic localization support.
  • Not documented for advanced configuration.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

not documented

import 'package:colornames/colornames.dart';

final color = Color(0xFFFFFF);
ColorNames.guess(color); // White
color.colorName; // White

final int colorValue = 128;
colorValue.colorName; // Navy Blue

Alternatives

Packages that do the same job and could replace colornames.