original_string: 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;
  	}
code: 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;
  	}
code_tokens: 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 ; }
docstring: Return saturation from hex
  
  @param hex $hex
  @return saturation
docstring_tokens: Return saturation from hex