web_dor_ligthest_brigths

The Business Responsive web dor ligthest brigths function.

Description

web_dor_ligthest_brigths( $color, $pracent ); 

Parameters (2)

0. $color
The color.
1. $pracent
The pracent.

Usage

  1. if ( !function_exists( 'web_dor_ligthest_brigths' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The color. 
  5. $color = null; 
  6.  
  7. // The pracent. 
  8. $pracent = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = web_dor_ligthest_brigths($color, $pracent); 
  12.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function web_dor_ligthest_brigths($color, $pracent) { 
  2.  
  3. $new_color=$color; 
  4. if(!(strlen($new_color==6) || strlen($new_color)==7)) 
  5. return $color; 
  6. $color_vandakanishov=strpos($new_color, '#'); 
  7. if($color_vandakanishov == false) { 
  8. $new_color= str_replace('#', '', $new_color); 
  9. $color_part_1=substr($new_color, 0, 2); 
  10. $color_part_2=substr($new_color, 2, 2); 
  11. $color_part_3=substr($new_color, 4, 2); 
  12. $color_part_1=dechex( (int) (hexdec( $color_part_1 ) + (( 255-( hexdec( $color_part_1 ) ) ) * $pracent / 100 ))); 
  13. $color_part_2=dechex( (int) (hexdec( $color_part_2) + (( 255-( hexdec( $color_part_2 ) ) ) * $pracent / 100 ))); 
  14. $color_part_3=dechex( (int) (hexdec( $color_part_3 ) + (( 255-( hexdec( $color_part_3 ) ) ) * $pracent / 100 ))); 
  15. $new_color=$color_part_1.$color_part_2.$color_part_3; 
  16. if($color_vandakanishov == false) { 
  17. return $new_color; 
  18. else{ 
  19. return '#'.$new_color; 
  20.