Exemplo n.º 1
0
 /**
  * @param $hex
  * @return bool
  */
 public static function getNameFromHex($hex)
 {
     $hex = HexValidator::validateHex($hex);
     foreach (self::getAll() as $color) {
         if ($color[0] == $hex) {
             return $color[1];
         }
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * Color constructor.
  * @param $originalHex
  * @param $colourName
  * @param $hex
  */
 public function __construct($originalHex, $colourName, $hex)
 {
     $this->originalHex = HexValidator::validateHex($originalHex);
     $this->colourName = $colourName;
     $this->hex = HexValidator::validateHex($hex);
 }