wc_light_or_dark()WC 1.0

Detect if we should use a light or dark color on a background color.

No Hooks.

Return

String.

Usage

wc_light_or_dark( $color, $dark, $light );
$color(mixed) (required)
Color.
$dark(string)
Darkest reference.
Default: '#000000'
$light(string)
Lightest reference.
Default: '#FFFFFF'

wc_light_or_dark() code WC 8.6.1

function wc_light_or_dark( $color, $dark = '#000000', $light = '#FFFFFF' ) {
	return wc_hex_is_light( $color ) ? $dark : $light;
}