LABColor

LABColor[l,a,b]

is a color directive with lightness l and color components a and b.

LABColor[l,a,b,α]

specifies opacity α.

Details

  • LABColor is a color space designed to have perceptual uniformity; i.e. equal changes in its components will be perceived by a human to have equal effects. LABColor is the basis for ColorDistance.
  • LABColor is device independent and corresponds to the CIE 1976 color space with .
  • The parameters have the following interpretation:
  • llightness or approximate luminance
    acolor, green (negative) to magenta (positive)
    bcolor, blue (negative) to yellow (positive)
  • The parameters , , and are given by , TemplateBox[{a, *}, Superscript]=500 (f(x/x_n)-f(y/y_n)), and TemplateBox[{b, *}, Superscript]=200 (f(y/y_n)-f(z/z_n)), where , , and are color parameters, , , and are white point parameters in XYZColor, and is a piecewise function that is equal to for and for .
  • LABColor allows any real number for l, a, and b.
  • RGBColor approximately corresponds to l between 0 and 1, a between and , and b between and .
  • ColorConvert can be used to convert LABColor to other color spaces.
  • The alternative forms LABColor[{l,a,b}] and LABColor[{l,a,b,α}] can also be used. »
  • {LABColor[], p1, } indicates that graphics primitives pi should be displayed in the color given.
  • Style[expr,LABColor[]] specifies that expr should be displayed with the specified color. »
  • For 3D surfaces, explicit LABColor directives define surface colors; the final shading depends on lighting and contributions from specularity and glow. »
  • Glow[LABColor[]] specifies color independent of lighting. »
  • LABColor[l,a,b,α] is equivalent to Directive[LABColor[l,a,b],Opacity[α]]. »
  • If no opacity has been specified, LABColor[l,a,b] is equivalent to LABColor[l,a,b,1].

Examples

open allclose all

Basic Examples  (4)

Specify the color of graphics primitives:

Specify the color with opacity:

Specify the output color of expressions:

Specify the color of plots:

Scope  (3)

Colors in 3D  (1)

Use diffuse surface color:

Use diffuse and specular surface color:

Use glow color, setting the diffuse surface color to black:

Color Operations  (2)

Use Blend to mix two or more colors:

Use Lighter and Darker to mix with white and black, respectively:

Generalizations & Extensions  (2)

LABColor[{l,a,b}] is equivalent to LABColor[l,a,b]:

Use Opacity with LABColor:

Use the opacity argument in LABColor directly:

Applications  (2)

Define a color negation using LABColor:

ColorNegate by default operates using RGBColor:

If color negation is defined as LABColor[l,-a,-b] the lightness is preserved:

Show a bubble chart of color distribution using the a and b channels of the Lab color space:

A 3D bubble chart:

Properties & Relations  (3)

The RGB gamut in Lab color space:

Blend of LABColor directives happens in the Lab parameter space:

ColorDistance by default computes the EuclideanDistance in the Lab color space:

Neat Examples  (1)

Visualizing the color space:

Introduced in 2014
 (10.0)