]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/php/PHPColors/Color.php
Use short form array syntax everywhere
[friendica.git] / view / theme / frio / php / PHPColors / Color.php
index d1543036c485b063f442f6d761296cf79c597329..3f290becf49d40baa10dac112fc0ebd2e15bae35 100644 (file)
@@ -63,7 +63,7 @@ class Color {
         $G = hexdec($color[2].$color[3]);
         $B = hexdec($color[4].$color[5]);
 
-        $HSL = array();
+        $HSL = [];
 
         $var_R = ($R / 255);
         $var_G = ($G / 255);
@@ -110,13 +110,13 @@ class Color {
      * @return string HEX string
      * @throws Exception "Bad HSL Array"
      */
-    public static function hslToHex( $hsl = array() ){
+    public static function hslToHex( $hsl = [] ){
          // Make sure it's HSL
         if(empty($hsl) || !isset($hsl["H"]) || !isset($hsl["S"]) || !isset($hsl["L"]) ) {
             throw new Exception("Param was not an HSL array");
         }
 
-        list($H,$S,$L) = array( $hsl['H']/360,$hsl['S'],$hsl['L'] );
+        list($H,$S,$L) = [ $hsl['H']/360,$hsl['S'],$hsl['L'] ];
 
         if( $S == 0 ) {
             $r = $L * 255;
@@ -181,7 +181,7 @@ class Color {
      * @return string RGB string
      * @throws Exception "Bad RGB Array"
      */
-    public static function rgbToHex( $rgb = array() ){
+    public static function rgbToHex( $rgb = [] ){
          // Make sure it's RGB
         if(empty($rgb) || !isset($rgb["R"]) || !isset($rgb["G"]) || !isset($rgb["B"]) ) {
             throw new Exception("Param was not an RGB array");
@@ -253,7 +253,7 @@ class Color {
         }
 
         // Return our gradient array
-        return array( "light" => $lightColor, "dark" => $darkColor );
+        return [ "light" => $lightColor, "dark" => $darkColor ];
     }
 
 
@@ -308,7 +308,7 @@ class Color {
         // Return the new value in HEX
         return self::hslToHex($hsl);
     }
-    
+
     /**
      * Returns your color's HSL array
      */
@@ -327,7 +327,7 @@ class Color {
     public function getRgb() {
         return $this->_rgb;
     }
-    
+
     /**
      * Returns the cross browser CSS3 gradient
      * @param int $amount Optional: percentage amount to light/darken the gradient
@@ -435,7 +435,7 @@ class Color {
          $gmix = (($rgb1['G'] * $r1) + ($rgb2['G'] * $r2)) / 2;
          $bmix = (($rgb1['B'] * $r1) + ($rgb2['B'] * $r2)) / 2;
 
-         return array('R' => $rmix, 'G' => $gmix, 'B' => $bmix);
+         return ['R' => $rmix, 'G' => $gmix, 'B' => $bmix];
      }
 
     /**