public function __construct($hue, $saturation, $value, $alpha) { parent::__construct($hue, $saturation, $value); $this->alpha = MathUtil::capValue($alpha, 0.0, 1.0); }
/** * @param int $value * @return $this */ public function withValue($value) { $color = clone $this; $color->value = MathUtil::capValue($value, 0.0, 1.0); return $color; }
/** * @param int $saturation * @return $this */ public function withSaturation($saturation) { $color = clone $this; $color->saturation = MathUtil::capValue($saturation, 0.0, 1.0); return $color; }
public function __construct($red, $green, $blue) { $this->red = MathUtil::capValue($red, 0, 255); $this->green = MathUtil::capValue($green, 0, 255); $this->blue = MathUtil::capValue($blue, 0, 255); }
public function __construct($hue, $saturation, $lightness) { parent::__construct($hue, $saturation); $this->lightness = MathUtil::capValue($lightness, 0.0, 1.0); }
/** * @param int $blue * @return $this */ public function withBlue($blue) { $color = clone $this; $color->blue = MathUtil::capValue($blue, 0, 255); return $color; }
/** * @param float $alpha * @return $this */ public function withAlpha($alpha) { $color = clone $this; $color->alpha = MathUtil::capValue($alpha, 0.0, 1.0); return $color; }
/** * @param int $z * @return $this */ public function withZ($z) { $color = clone $this; $color->z = MathUtil::capValue($z, 0, 100); return $color; }
public function __construct($x, $y, $z) { $this->x = MathUtil::capValue($x, 0, self::REF_X); $this->y = MathUtil::capValue($y, 0, self::REF_Y); $this->z = MathUtil::capValue($z, 0, self::REF_Z); }
/** * @param int $lightness * @return $this */ public function withLightness($lightness) { $color = clone $this; $color->lightness = MathUtil::capValue($lightness, 0.0, 1.0); return $color; }
/** * @param int $b * @return $this */ public function withB($b) { $color = clone $this; $color->b = MathUtil::capValue($b, -128, 127); return $color; }
public function __construct($hue, $saturation, $value) { parent::__construct($hue, $saturation); $this->value = MathUtil::capValue($value, 0.0, 1.0); }
public function __construct($red, $green, $blue, $alpha) { parent::__construct($red, $green, $blue); $this->alpha = MathUtil::capValue($alpha, 0.0, 1.0); }
public function __construct($hue, $saturation) { $this->hue = MathUtil::rotateValue($hue, 360); $this->saturation = MathUtil::capValue($saturation, 0.0, 1.0); }