liveBook · Manning

Brightness

As explained in Web Components in Action

Brightness is the color attribute describing the perceived lightness of a color.

Brightness describes the perceived lightness of a color. In a color picker, users adjust it by dragging vertically while adjusting saturation horizontally. section 11.1

A brightness control typically works as a two-dimensional coordinate picker:

  • The horizontal x-axis controls saturation, or color intensity. section 11.1
  • The vertical y-axis controls brightness. section 11.2
  • Dragging in both directions selects a combined saturation-and-brightness value. section 11.1

A red-background coordinate picker

A coordinate picker can use a red background with a white-to-transparent horizontal overlay and a transparent-to-black vertical overlay. Moving the thumbnail vertically changes brightness, while horizontal movement changes saturation. section 11.2

Figure 11.5. Saturation and brightness picker as a candidate for a web component

Use the saturation-and-brightness picker figure to see the two-axis interaction that combines horizontal saturation with vertical brightness. section 11.1

How Web Components in Action covers it

How deep it goes
Defines perceived lightness and implements it as a normalized y-axis percentage, without discussing color-model internals.
Examples
Demonstrates brightness with a two-dimensional picker using gradient overlays and a red background.
What it assumes
Assumes familiarity with saturation, horizontal and vertical coordinates, HTML elements, and basic Web Component structure.
What you can do after
Build it from scratch as the vertical control of a coordinate-picker Web Component.
How it connects
Connects brightness to saturation, coordinate pickers, color pickers, Web Components, and mouse events.

Also explained in

Compare how 7 books explain brightness →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Components in Action. The section links point to the parts of the book it draws on.