Exemple #1
0
 public function __construct($hue, $saturation, $value, $alpha)
 {
     parent::__construct($hue, $saturation, $value);
     $this->alpha = MathUtil::capValue($alpha, 0.0, 1.0);
 }
Exemple #2
0
 /**
  * @param int $value
  * @return $this
  */
 public function withValue($value)
 {
     $color = clone $this;
     $color->value = MathUtil::capValue($value, 0.0, 1.0);
     return $color;
 }
Exemple #3
0
 /**
  * @param int $saturation
  * @return $this
  */
 public function withSaturation($saturation)
 {
     $color = clone $this;
     $color->saturation = MathUtil::capValue($saturation, 0.0, 1.0);
     return $color;
 }
Exemple #4
0
 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);
 }
Exemple #5
0
 public function __construct($hue, $saturation, $lightness)
 {
     parent::__construct($hue, $saturation);
     $this->lightness = MathUtil::capValue($lightness, 0.0, 1.0);
 }
Exemple #6
0
 /**
  * @param int $blue
  * @return $this
  */
 public function withBlue($blue)
 {
     $color = clone $this;
     $color->blue = MathUtil::capValue($blue, 0, 255);
     return $color;
 }
Exemple #7
0
 /**
  * @param float $alpha
  * @return $this
  */
 public function withAlpha($alpha)
 {
     $color = clone $this;
     $color->alpha = MathUtil::capValue($alpha, 0.0, 1.0);
     return $color;
 }
Exemple #8
0
 /**
  * @param int $z
  * @return $this
  */
 public function withZ($z)
 {
     $color = clone $this;
     $color->z = MathUtil::capValue($z, 0, 100);
     return $color;
 }
Exemple #9
0
 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);
 }
Exemple #10
0
 /**
  * @param int $lightness
  * @return $this
  */
 public function withLightness($lightness)
 {
     $color = clone $this;
     $color->lightness = MathUtil::capValue($lightness, 0.0, 1.0);
     return $color;
 }
Exemple #11
0
 /**
  * @param int $b
  * @return $this
  */
 public function withB($b)
 {
     $color = clone $this;
     $color->b = MathUtil::capValue($b, -128, 127);
     return $color;
 }
Exemple #12
0
 public function __construct($hue, $saturation, $value)
 {
     parent::__construct($hue, $saturation);
     $this->value = MathUtil::capValue($value, 0.0, 1.0);
 }
Exemple #13
0
 public function __construct($red, $green, $blue, $alpha)
 {
     parent::__construct($red, $green, $blue);
     $this->alpha = MathUtil::capValue($alpha, 0.0, 1.0);
 }
Exemple #14
0
 public function __construct($hue, $saturation)
 {
     $this->hue = MathUtil::rotateValue($hue, 360);
     $this->saturation = MathUtil::capValue($saturation, 0.0, 1.0);
 }