feature: natürliche Modellklassen können in andere Farbsysteme transformiert werden

This commit is contained in:
2022-03-03 15:09:09 +01:00
parent 5941c17a8a
commit 49ef3b83f6
10 changed files with 161 additions and 2 deletions
@@ -22,6 +22,14 @@ class CyanMagentaYellowKey
$this->percentValuesHelper = new Helper\PercentValues();
}
/**
* @return PureCyanMagentaYellowKey
*/
public function getPureColor(): PureCyanMagentaYellowKey
{
return $this->pureColor;
}
/**
* @return int
*/
@@ -10,7 +10,7 @@ class GradValues
public function asGradValue(float $value): int
{
return intval($value * 360);
return intval(round($value * 360, 0, PHP_ROUND_HALF_UP));
}
public function fromGradValue(int $value): float
@@ -10,7 +10,7 @@ class PercentValues
public function asPercentValue(float $value): int
{
return intval($value * 100);
return intval(round($value * 100, 0, PHP_ROUND_HALF_UP));
}
public function fromPercentValue(int $value): float
@@ -25,6 +25,14 @@ class HueSaturationValue
$this->gradValuesHelper = new Helper\GradValues();
}
/**
* @return PureHueSaturationValue
*/
public function getPureColor(): PureHueSaturationValue
{
return $this->pureColor;
}
/**
* @return int
*/
@@ -21,6 +21,14 @@ class RedGreenBlue
$this->hexadecimalValuesHelper = new Helper\HexadecimalValues();
}
/**
* @return PureRedGreenBlue
*/
public function getPureColor(): PureRedGreenBlue
{
return $this->pureColor;
}
/**
* @return int
*/