hwb()

The hwb() functional notation expresses a given color according to its hue, whiteness, and blackness. An optional alpha component represents the color's transparency.

Try it

Syntax

css

hwb(194 0% 0%) /* #00c3ff */
hwb(194 0% 0% / .5) /* #00c3ff with 50% opacity */

Values

Functional notation: hwb(H W B[ / A])

H

A <number> or an <angle> representing the hue angle. More details on this type can be found on the <hue> reference.

W, B

<percentage> representing whiteness and blackness, respectively, that specifies the amount of white and black to mix in, from 0% (no whiteness or blackness) to 100% (full whiteness or blackness).

If W + B = 100%, it defines some shade of gray. If W + B > 100%, W and B are effectively normalized as W / (W + B) and B / (W + B), respectively.

A Optional

An <alpha-value>, where the number 1 corresponds to 100% (full opacity).

Formal syntax

<hwb()> = 
hwb( [ <hue> | none ] [ <percentage> | none ] [ <percentage> | none ] [ / [ <alpha-value> | none ] ]? )

<hue> =
<number> |
<angle>

<alpha-value> =
<number> |
<percentage>

Specifications

Specification
CSS Color Module Level 4
# the-hwb-notation

Browser compatibility

BCD tables only load in the browser

See also

  • <color>: For a list of all color notations