private static function _get_saturation( $hex ) {
		$red   = hexdec( substr( $hex, 0, 2 ) );
		$green = hexdec( substr( $hex, 2, 2 ) );
		$blue  = hexdec( substr( $hex, 4, 2 ) );
		$max_rgb = max( $red, $green, $blue );
		$min_rgb = min( $red, $green, $blue );

		$cnt = round( ( $max_rgb + $min_rgb ) / 2 );
		if ( 127 >= $cnt ) {
			$tmp = ( $max_rgb + $min_rgb );
			$saturation = $tmp ? ( $max_rgb - $min_rgb ) / $tmp : 0;
		} else {
			$tmp = ( 510 - $max_rgb - $min_rgb );
			$saturation = ( $tmp ) ? ( ( $max_rgb - $min_rgb ) / $tmp ) : 0;
		}
		return $saturation * 100;
	}
private static function _get_saturation( $hex ) {
		$red   = hexdec( substr( $hex, 0, 2 ) );
		$green = hexdec( substr( $hex, 2, 2 ) );
		$blue  = hexdec( substr( $hex, 4, 2 ) );
		$max_rgb = max( $red, $green, $blue );
		$min_rgb = min( $red, $green, $blue );

		$cnt = round( ( $max_rgb + $min_rgb ) / 2 );
		if ( 127 >= $cnt ) {
			$tmp = ( $max_rgb + $min_rgb );
			$saturation = $tmp ? ( $max_rgb - $min_rgb ) / $tmp : 0;
		} else {
			$tmp = ( 510 - $max_rgb - $min_rgb );
			$saturation = ( $tmp ) ? ( ( $max_rgb - $min_rgb ) / $tmp ) : 0;
		}
		return $saturation * 100;
	}
private static function _get_saturation ( $ hex ) { $ red = hexdec ( substr ( $ hex , 0 , 2 ) ) ; $ green = hexdec ( substr ( $ hex , 2 , 2 ) ) ; $ blue = hexdec ( substr ( $ hex , 4 , 2 ) ) ; $ max_rgb = max ( $ red , $ green , $ blue ) ; $ min_rgb = min ( $ red , $ green , $ blue ) ; $ cnt = round ( ( $ max_rgb + $ min_rgb ) / 2 ) ; if ( 127 >= $ cnt ) { $ tmp = ( $ max_rgb + $ min_rgb ) ; $ saturation = $ tmp ? ( $ max_rgb - $ min_rgb ) / $ tmp : 0 ; } else { $ tmp = ( 510 - $ max_rgb - $ min_rgb ) ; $ saturation = ( $ tmp ) ? ( ( $ max_rgb - $ min_rgb ) / $ tmp ) : 0 ; } return $ saturation * 100 ; }
Return saturation from hex

@param hex $hex
@return saturation
Return saturation from hex