Add a sky gradient

@api
@param float  $x     X value
@param string $color Color value
@return static
495746
public function addSkyGradient($x, $color)
    {
        $skyGradientKey = new SkyGradientKey($x, $color);
        return $this->addSkyGradientKey($skyGradientKey);
    }
1291136
public function merge(Color $color1, Color $color2, $percentage = 50)
    {
        return new Color(array(
            'red' => $this->getMergedColorPart('red', $color1, $color2, $percentage),
            'green' => $this->getMergedColorPart('green', $color1, $color2, $percentage),
            'blue' => $this->getMergedColorPart('blue', $color1, $color2, $percentage)
        ));
    }
371677
public final RadialGradient addColorStop(final double stop, final IColor color)
    {
        m_jso.addColorStop(stop, color.getColorString());

        return this;
    }
1199075
private function restrictRgbColorSpace($c, $color, &$PDFAXwarnings = [])
	{
		if ($this->mpdf->PDFX || ($this->mpdf->PDFA && $this->mode == 3)) {
			if (($this->mpdf->PDFA && !$this->mpdf->PDFAauto) || ($this->mpdf->PDFX && !$this->mpdf->PDFXauto)) {
				$PDFAXwarnings[] = "RGB color specified '" . $color . "' (converted to CMYK)";
			}
			$c = $this->colorModeConverter->rgb2cmyk($c);
		} elseif ($this->mode == 1) {
			$c = $this->colorModeConverter->rgb2gray($c);
		} elseif ($this->mode == 3) {
			$c = $this->colorModeConverter->rgb2cmyk($c);
		}

		return $c;
	}
518850
public function fg($color)
    {
        Assert::nullOrOneOf($color, self::$colors, 'The color must be null or one of the Style::* color constants. Got: "%s"');

        $this->fgColor = $color;

        return $this;
    }
712048
public function setColor($color)
	{
		if (is_array($color))
		{
			$this->color[0] = $color[0];
			$this->color[1] = $color[1];
			$this->color[2] = $color[2];
		}
		else
		{
			$color = ltrim($color, '#');

			$this->color[0] = hexdec(substr($color, 0, 2));
			$this->color[1] = hexdec(substr($color, 2, 2));
			$this->color[2] = hexdec(substr($color, 4, 2));
		}

		return $this;
	}
950808
public function getBrightnessDifference($color1, $color2): float
    {
        return Plugin::$plugin->color->getBrightnessDifference($color1, $color2);
    }
215505
protected function initColor($color, $default)
    {
        if ($color == null) {
            return new Securimage_Color($default);
        } else if (is_string($color)) {
            try {
                return new Securimage_Color($color);
            } catch(Exception $e) {
                return new Securimage_Color($default);
            }
        } else if (is_array($color) && sizeof($color) == 3) {
            return new Securimage_Color($color[0], $color[1], $color[2]);
        } else {
            return new Securimage_Color($default);
        }
    }
464943
private static GradientDrawable getKitkatBackground(int color) {
        final GradientDrawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setCornerRadius(BackgroundUtils.convertToDIP(24));
        gradientDrawable.setColor(color);
        return gradientDrawable;
    }
1121440
public function addColor(Color $color)
    {
        if (!$this->colors->contains($color)) {
            $this->colors->add($color);
            $color->setInteractionSelection($this);
        }
    }
806558
public function fill_color( $color, $alpha = 1 ) 
	{
		$alpha = $alpha * 127;

		// parse the color
		$color = CCColor::create( $color );
		$color = imagecolorallocatealpha( $this->image_context, $color->RGB[0], $color->RGB[1], $color->RGB[2], $alpha );

		// run image fill
		imagefill( $this->image_context, 0, 0, $color );

		return $this;
	}
84264
public function color($color)
    {
        if ($color !== null) {
            Checkers::checkColor($color, null);
        }
        $this->color = $color;
        return $this;
    }
1178309
function fill($color = '#000000') {
        $rgba = $this->normalize_color($color);
        $fill_color = imagecolorallocatealpha($this->image, $rgba['r'], $rgba['g'], $rgba['b'], $rgba['a']);
        imagealphablending($this->image, false);
        imagesavealpha($this->image, true);
        imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, $fill_color);
        return $this;
    }
890092
public function getDiff($color)
    {
        if (!$color instanceof Color) {
            $color = new Color($color);
        }
        return pow($this->r - $color->r, 2)
            + pow($this->g - $color->g, 2)
            + pow($this->b - $color->b, 2);
    }
372196
public function addColor($color)
    {
        if ( ! $color instanceof Color ) {
            $color = new Color($color);
        }

        $this->colors []= $color;
    }
893001
public function colorize($color, $opacity)
    {
        $rgb = $this->hex2rgb($color);
        $alpha = $this->keep_within(127 - (127 * $opacity), 0, 127);
        imagefilter($this->image, IMG_FILTER_COLORIZE, $this->keep_within($rgb['r'], 0, 255), $this->keep_within($rgb['g'], 0, 255), $this->keep_within($rgb['b'], 0, 255), $alpha);

        return $this;
    }
397051
public function setForegroundHexColor($foregroundHexColor)
    {
        if ( is_null($this->frontColor) ) {
            $this->frontColor = new Color;
        }

        $this->frontColor->hex($foregroundHexColor);

        return $this;
    }