Skip to main content

is_dark_color()

public static function is_dark_color( $color='', $threshold=465 )

Detect if a color is dark against a passed threshold. Default is set at 465 in the range of 1 - 765.

Since: 2.7

Source: common.php:8090

Parameters

NameTypeDefaultDescription
$colorstring''The color string to test, as a hex code (either 3 or 6 digits).
$thresholdfloat465The threshold to return true at in a range of 1 - 765.

Returns

  • bool