Gradient.php 858 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. declare(strict_types = 1);
  3. namespace BaconQrCode\Renderer\RendererStyle;
  4. use BaconQrCode\Renderer\Color\ColorInterface;
  5. final class Gradient
  6. {
  7. /**
  8. * @var ColorInterface
  9. */
  10. private $startColor;
  11. /**
  12. * @var ColorInterface
  13. */
  14. private $endColor;
  15. /**
  16. * @var GradientType
  17. */
  18. private $type;
  19. public function __construct(ColorInterface $startColor, ColorInterface $endColor, GradientType $type)
  20. {
  21. $this->startColor = $startColor;
  22. $this->endColor = $endColor;
  23. $this->type = $type;
  24. }
  25. public function getStartColor() : ColorInterface
  26. {
  27. return $this->startColor;
  28. }
  29. public function getEndColor() : ColorInterface
  30. {
  31. return $this->endColor;
  32. }
  33. public function getType() : GradientType
  34. {
  35. return $this->type;
  36. }
  37. }