Which is defined color

@param string $colorName Color name
@return bool Which is defined color
182436
private function _isDefinedColor ( $colorName ) {
        $colors = self::getDefinedColors();
        $colorNames = array_keys($colors);
        return in_array($colorName, $colorNames);
    }
1076959
public function has(string $name): bool
    {
        $name = $this->getDefinitiveName($name);

        return isset($this->instances[$name]);
    }
181491
public function hasMethod($methodName)
    {
        $methodNameLower = strtolower($methodName);
        foreach ($this->methods as $name => $method) {
            if ($methodNameLower == $name) {
                return true;
            }
        }

        $extendsClassDefinition = $this->getExtendsClassDefinition();
        if ($extendsClassDefinition instanceof ClassDefinitionRuntime) {
            try {
                $extendsClassDefinition = $this->compiler->getInternalClassDefinition(
                    $extendsClassDefinition->getName()
                );
            } catch (\ReflectionException $e) {
                // Do nothing
                return false;
            }
        }

        while ($extendsClassDefinition instanceof self) {
            if ($extendsClassDefinition->hasMethod($methodName)) {
                return true;
            }

            $extendsClassDefinition = $extendsClassDefinition->getExtendsClassDefinition();
        }

        return false;
    }
658840
public function hasDiscriminatorValue($className)
    {
        if (array_key_exists($className, $this->discriminatorValueMap)) {
            return false !== $this->discriminatorValueMap[$className];
        }
        $this->discriminatorValueMap[$className] = $this->buildDiscriminatorValueMap($className);

        return $this->discriminatorValueMap[$className];
    }
1185465
protected function hasProperty(string $propertyName): bool
    {
        if (count($this->values) === 1
          && isset($this->values['__value'])
          && 'value' === $propertyName) {
            return isset($this->values['__value']);
        }

        return isset($this->values[$propertyName]);
    }
499659
public function addInputColor(string $name) : Element\Input\Color
    {
        $input = new Element\Input\Color($this, $name);
        $this->addComponent($name, $input);

        return $input;
    }
369737
protected function isWhiteListed($content)
    {
        if (isset($this->functionWhitelist) === false) {
            return false;
        }

        if (\is_string($this->functionWhitelist) === true) {
            if (strpos($this->functionWhitelist, ',') !== false) {
                $this->functionWhitelist = explode(',', $this->functionWhitelist);
            } else {
                $this->functionWhitelist = (array) $this->functionWhitelist;
            }
        }

        if (\is_array($this->functionWhitelist) === true) {
            $this->functionWhitelist = array_map('strtolower', $this->functionWhitelist);
            return \in_array($content, $this->functionWhitelist, true);
        }

        return false;
    }
471411
public function hasDefinition($varName)
    {
        return $this->contains(function ($index, LineInterface $line) use ($varName) {
            return $line->key() == $varName;
        });
    }
736236
static function resolveColor($color) {
        if(\is_int($color)) {
            return $color;
        }
        
        if(!\is_array($color)) {
            return \hexdec(((string) $color));
        }
        
        if(\count($color) < 1) {
            throw new \InvalidArgumentException('Color "'.\var_export($color, true).'" is not resolvable');
        }
        
        return (($color[0] << 16) + (($color[1] ?? 0) << 8) + ($color[2] ?? 0));
    }
567904
public function colorDifference(Color $color): int
    {
        $color2 = $color->getRgb();

        return (int)abs($this->colors['r'] - $color2['r'])
            + (int)abs($this->colors['g'] - $color2['g'])
            + (int)abs($this->colors['b'] - $color2['b']);
    }
646325
protected function getColor($im, $color) {
        if ($color === self::COLOR_BG) {
            return $this->colorBg->allocate($im);
        } else {
            return $this->colorFg->allocate($im);
        }
    }
40436
protected function importingColor($SSName, $data)
    {
        $color = $this->{$SSName};
        if (!$color) {
            $color = new Color();
        }
        $this->Fetched = date("Y-m-d H:i:s");
        $color->OrganisationID = $this->OrganisationID;
        $color->HailOrgID = $this->HailOrgID;
        $color->HailOrgName = $this->HailOrgName;

        $this->{$SSName} = $color;
    }
532401
public static function Color2Hex( $colorDefinition )
   {

      if ( \is_array( $colorDefinition ) )
      {
         if ( \count( $colorDefinition ) != 3 )
         {
            throw new ArgumentError(
               'colorDefinition',
               $colorDefinition,
               'Drawing',
               'A rgb array with 3 Elements is required!'
            );
         }
         return static::Rgb2Hex( $colorDefinition );
      }

      if ( static::IsHexFormat( $colorDefinition ) )
      {
         return $colorDefinition;
      }

      $uc = \strtolower( $colorDefinition );

      if ( isset( static::$ColornameHex[ $uc ] ) )
      {
         return \strtolower( static::$ColornameHex[ $uc ] );
      }

      if ( false !== ( $hex = static::Rgb2Hex( $colorDefinition ) ) )
      {
         return $hex;
      }

      return false;

   }
950578
public function color($name, $value = null, $options = array())
    {
		return $this->input('color', $name, $value, $options);
    }
238237
public function getColorIndex($color)
    {
        $color = self::getColorAsFullHexCode($color);
        $index = array_search($color, $this->_colors);
        return $index !== false ? $index + 1 : false;
    }
593596
public function getBackgroundColorEscapeSequence ( $colorName = '' ) {
        if ( $this->_isDefinedColor($colorName) === true ) {
            $colors = self::getDefinedColors();
            list($textColor, $backgroundColor) = $colors[$colorName];
            return $backgroundColor;
        }
        return '';
    }
523594
protected function isValidColor($color)
	{
		$regexp = '\(([01]?\d\d?|2[0-4]\d|25[0-5])\W+([01]?\d\d?|2[0-4]\d|25[0-5])\W+([01]?\d\d?|2[0-4]\d|25[0-5])\)';
		
		return preg_grep("/{$color}/i", $this->getColors()) || preg_match('/^#(\d|a|b|c|d|e|f){3}$/i', $color)
			|| preg_match('/^#(\d|a|b|c|d|e|f){6}$/i', $color) || preg_match('/^(rgb)'.$regexp.'$/i', $color)
			|| preg_match('/^(rgba)'.$regexp.'?\W+([01](\.\d+)?)\)$/i', $color);
	}