Fix Calc
This commit is contained in:
parent
a57786d835
commit
7d30d4d34c
File diff suppressed because one or more lines are too long
@ -112,8 +112,10 @@ class Select extends Base
|
||||
foreach ($system->getAllColors() as $color) {
|
||||
$optColor = new \PSC\Library\Calc\Option\Type\Select\ColorOpt();
|
||||
$optColor->setId($color->getName());
|
||||
$optColor->setLabel(sprintf("%s %s", $system->getColorSystemPrefix(),$color->getValue("alias")));
|
||||
$optColor->setColor($color);
|
||||
$optColor->setLabel(sprintf("%s %s %s", $system->getColorSystemPrefix(), $color->getValue("name"), $system->getColorSystemSuffix()));
|
||||
$optColor->setColorHex($color->getHex());
|
||||
$optColor->setColorCMYK($color->getCMYK());
|
||||
$optColor->setColorRGB($color->getRGB());
|
||||
$optColor->setValue((string)$color->getHEX());
|
||||
$this->element->addOption($optColor);
|
||||
}
|
||||
|
||||
@ -1,13 +1,18 @@
|
||||
<?php
|
||||
namespace PSC\Library\Calc\Option\Type\Select;
|
||||
|
||||
use Color\Value\CMYK;
|
||||
use Color\Value\HEX;
|
||||
use Color\Value\RGB;
|
||||
use Color\Value\ValueInterface;
|
||||
use PSC\Library\Calc\General\Type\EdgeCollectionContainer;
|
||||
use PSC\Library\Calc\Option\Type\Base;
|
||||
|
||||
class ColorOpt extends Opt
|
||||
{
|
||||
protected $color = null;
|
||||
protected $colorHex = null;
|
||||
protected $colorCMYK = null;
|
||||
protected $colorRGB = null;
|
||||
private string $value = "";
|
||||
|
||||
public function setValue(string $value)
|
||||
@ -20,13 +25,33 @@ class ColorOpt extends Opt
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function getColor(): ValueInterface|null
|
||||
public function getColorHex(): HEX|null
|
||||
{
|
||||
return $this->color;
|
||||
return $this->colorHex;
|
||||
}
|
||||
|
||||
public function setColor(ValueInterface $color): void
|
||||
public function setColorHex(Hex $colorHex): void
|
||||
{
|
||||
$this->color = $color;
|
||||
$this->colorHex = $colorHex;
|
||||
}
|
||||
|
||||
public function getColorCMYK(): HEX|null
|
||||
{
|
||||
return $this->colorCMYK;
|
||||
}
|
||||
|
||||
public function setColorCMYK(CMYK $colorCMYK): void
|
||||
{
|
||||
$this->colorCMYK = $colorCMYK;
|
||||
}
|
||||
|
||||
public function getColorRGB(): HEX|null
|
||||
{
|
||||
return $this->colorRGB;
|
||||
}
|
||||
|
||||
public function setColorRGB(RGB $colorRGB): void
|
||||
{
|
||||
$this->colorRGB = $colorRGB;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user