lib/class-kirki-color.php
public static function brightness_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) {
		$color_1 = self::sanitize_hex( $color_1, false );
		$color_2 = self::sanitize_hex( $color_2, false );
		$color_1_rgb = self::get_rgb( $color_1 );
		$color_2_rgb = self::get_rgb( $color_2 );
		$br_1 = ( 299 * $color_1_rgb[0] + 587 * $color_1_rgb[1] + 114 * $color_1_rgb[2] ) / 1000;
		$br_2 = ( 299 * $color_2_rgb[0] + 587 * $color_2_rgb[1] + 114 * $color_2_rgb[2] ) / 1000;
		return intval( abs( $br_1 - $br_2 ) );
	}
public static function brightness_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) {
		$color_1 = self::sanitize_hex( $color_1, false );
		$color_2 = self::sanitize_hex( $color_2, false );
		$color_1_rgb = self::get_rgb( $color_1 );
		$color_2_rgb = self::get_rgb( $color_2 );
		$br_1 = ( 299 * $color_1_rgb[0] + 587 * $color_1_rgb[1] + 114 * $color_1_rgb[2] ) / 1000;
		$br_2 = ( 299 * $color_2_rgb[0] + 587 * $color_2_rgb[1] + 114 * $color_2_rgb[2] ) / 1000;
		return intval( abs( $br_1 - $br_2 ) );
	}
public static function brightness_difference ( $ color_1 = '#ffffff' , $ color_2 = '#000000' ) { $ color_1 = self :: sanitize_hex ( $ color_1 , false ) ; $ color_2 = self :: sanitize_hex ( $ color_2 , false ) ; $ color_1_rgb = self :: get_rgb ( $ color_1 ) ; $ color_2_rgb = self :: get_rgb ( $ color_2 ) ; $ br_1 = ( 299 * $ color_1_rgb [ 0 ] + 587 * $ color_1_rgb [ 1 ] + 114 * $ color_1_rgb [ 2 ] ) / 1000 ; $ br_2 = ( 299 * $ color_2_rgb [ 0 ] + 587 * $ color_2_rgb [ 1 ] + 114 * $ color_2_rgb [ 2 ] ) / 1000 ; return intval ( abs ( $ br_1 - $ br_2 ) ) ; }
This function tries to compare the brightness of the colors.
A return value of more than 125 is recommended.
Combining it with the color_difference function above might make sense.

@static
@access public
@param string $color_1 The 1st color.
@param string $color_2 The 2nd color.
@return string
This function tries to compare the brightness of the colors . A return value of more than 125 is recommended . Combining it with the color_difference function above might make sense .