Skip to main content

is-dark ()

Indicates whether a given color is considered dark.

Parameters

$color
The color which may be dark.
Type
Color

Return Value

Boolean
true if the given color is considered dark; otherwise, false.

Example

@use '@sass-fairy/color';

@debug color.is-dark(#000);
// true

@debug color.is-dark(#fff);
// false

@debug color.is-dark(darkgreen);
// true
info

See 24 ways’ calculating color contrast for more information.