d4_color

Creator: coderz1093

Last updated:

0 purchases

d4_color Image
d4_color Images

Languages

Categories

Add to Cart

Description:

d4 color

Color spaces! RGB, HSL, Cubehelix, CIELAB, and more.
This package provides representations for various color spaces, allowing
specification, conversion and manipulation. (Also see
d3_interpolate for color
interpolation.)
For example, take the color named “steelblue”:
final c = Color.parse("steelblue"); // {r: 70, g: 130, b: 180, opacity: 1}
copied to clipboard
Let’s try converting it to HSL:
final c = Hsl.from("steelblue"); // {h: 207.27…, s: 0.44, l: 0.4902…, opacity: 1}
copied to clipboard
Now rotate the hue by 90°, bump up the saturation, and format as a string for CSS:
c.h += 90;
c.s += 0.2;
c.toString(); // rgb(198, 45, 205)
copied to clipboard
To fade the color slightly:
c.opacity = 0.8;
c.toString(); // rgba(198, 45, 205, 0.8)
copied to clipboard
In addition to the ubiquitous and machine-friendly
RGB
and
HSL
color space, d4_color supports color spaces that are designed for humans:

CIELAB (a.k.a. “Lab”)
CIELChab (a.k.a. “LCh” or “HCL”)
Dave Green’s Cubehelix

Cubehelix features monotonic lightness, while CIELAB and its polar form
CIELChab are perceptually uniform.
export 'src/d4_color.dart';

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.