lib/class-kirki-color.php
public static function lumosity_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 );
		$l1 = 0.2126 * pow( $color_1_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_1_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_1_rgb[2] / 255, 2.2 );
		$l2 = 0.2126 * pow( $color_2_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_2_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_2_rgb[2] / 255, 2.2 );
		$lum_diff = ( $l1 > $l2 ) ? ( $l1 + 0.05 ) / ( $l2 + 0.05 ) : ( $l2 + 0.05 ) / ( $l1 + 0.05 );
		return round( $lum_diff, 2 );
	}
public static function lumosity_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 );
		$l1 = 0.2126 * pow( $color_1_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_1_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_1_rgb[2] / 255, 2.2 );
		$l2 = 0.2126 * pow( $color_2_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_2_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_2_rgb[2] / 255, 2.2 );
		$lum_diff = ( $l1 > $l2 ) ? ( $l1 + 0.05 ) / ( $l2 + 0.05 ) : ( $l2 + 0.05 ) / ( $l1 + 0.05 );
		return round( $lum_diff, 2 );
	}
public static function lumosity_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 ) ; $ l1 = 0.2126 * pow ( $ color_1_rgb [ 0 ] / 255 , 2.2 ) + 0.7152 * pow ( $ color_1_rgb [ 1 ] / 255 , 2.2 ) + 0.0722 * pow ( $ color_1_rgb [ 2 ] / 255 , 2.2 ) ; $ l2 = 0.2126 * pow ( $ color_2_rgb [ 0 ] / 255 , 2.2 ) + 0.7152 * pow ( $ color_2_rgb [ 1 ] / 255 , 2.2 ) + 0.0722 * pow ( $ color_2_rgb [ 2 ] / 255 , 2.2 ) ; $ lum_diff = ( $ l1 > $ l2 ) ? ( $ l1 + 0.05 ) / ( $ l2 + 0.05 ) : ( $ l2 + 0.05 ) / ( $ l1 + 0.05 ) ; return round ( $ lum_diff , 2 ) ; }
Uses the luminosity to calculate the difference between the given colors.
The returned value should be bigger than 5 for best readability.

@static
@access public
@param string $color_1 The 1st color.
@param string $color_2 The 2nd color.
@return string
Uses the luminosity to calculate the difference between the given colors . The returned value should be bigger than 5 for best readability .