refactor/texte-verbessern #11
@@ -9,11 +9,11 @@ namespace TorstenHettstedt\Colors\ColorModels;
|
||||
*/
|
||||
class CyanMagentaYellowKey extends AbstractColorModel
|
||||
{
|
||||
/** @var float : Definition des Cyan-Anteil */
|
||||
/** @var float : Definition des Cyan-Anteils */
|
||||
protected float $cyan = 0.0;
|
||||
/** @var float : Definition des Magenta-Anteil */
|
||||
/** @var float : Definition des Magenta-Anteils */
|
||||
protected float $magenta = 0.0;
|
||||
/** @var float : Definition des Gelbanteil */
|
||||
/** @var float : Definition des Gelbanteiles */
|
||||
protected float $yellow = 0.0;
|
||||
/** @var float : Definition des Schwarzanteil */
|
||||
protected float $key = 0.0;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace TorstenHettstedt\Colors\ColorModels;
|
||||
*/
|
||||
class HueSaturationValue extends AbstractColorModel
|
||||
{
|
||||
/** @var float : Definition des Farbton als Anteil eines Vollkreises '$Hue * π' */
|
||||
/** @var float : Definition des Farbtones als Anteil eines Vollkreises '$Hue * π' */
|
||||
protected float $hue = 0.0;
|
||||
/** @var float : Definition der Sättigung der Farbe */
|
||||
protected float $saturation = 0.0;
|
||||
|
||||
@@ -8,11 +8,11 @@ namespace TorstenHettstedt\Colors\ColorModels;
|
||||
*/
|
||||
class RedGreenBlue extends AbstractColorModel
|
||||
{
|
||||
/** @var float : Definition des Rotanteil */
|
||||
/** @var float : Definition des Rot-Anteils */
|
||||
protected float $red = 1.0;
|
||||
/** @var float : Definition des Grünanteil */
|
||||
/** @var float : Definition des Grün-Anteils */
|
||||
protected float $green = 1.0;
|
||||
/** @var float : Definition des Grünanteil */
|
||||
/** @var float : Definition des Blau-Anteils */
|
||||
protected float $blue = 1.0;
|
||||
|
||||
/**
|
||||
|
||||
@@ -70,7 +70,7 @@ class RedGreenBlue
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getBlue(): int
|
||||
#[Pure] public function getBlue(): int
|
||||
{
|
||||
return $this->hexadecimalValuesHelper->asHexadecimalValue($this->pureColor->getBlue());
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class RedGreenBlue
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function asHtmlNotation(): string
|
||||
#[Pure] public function asHtmlNotation(): string
|
||||
{
|
||||
return sprintf('#%X%X%X', $this->getRed(), $this->getGreen(), $this->getBlue());
|
||||
}
|
||||
|
||||
@@ -8,11 +8,11 @@ use TorstenHettstedt\Colors\ColorModels\HueSaturationValue;
|
||||
|
||||
abstract class AbstractHueSaturationValueToUtility
|
||||
{
|
||||
/** @var int : Größe des Intervals in 1/100 Grad */
|
||||
/** @var float : Größe des Intervals in 1/100 Grad */
|
||||
protected const INTERVAL = 60.0 * 100.0;
|
||||
|
||||
// Daten für HSV
|
||||
/** @var float : Definition des Farbton als Anteil eines Vollkreises '$Hue * π' */
|
||||
/** @var float : Definition des Farbtones als Anteil eines Vollkreises '$Hue * π' */
|
||||
protected float $hue;
|
||||
/** @var float : Anteil am Vollkreis in 1/100 Grad */
|
||||
protected float $hueAsPercentGrad;
|
||||
|
||||
@@ -15,11 +15,11 @@ class CyanMagentaYellowKeyToHueSaturationValue
|
||||
const PROPERTY_KEY = 'key';
|
||||
|
||||
// Daten für CMYK
|
||||
/** @var float : Definition des Cyan-Anteil */
|
||||
/** @var float : Definition des Cyan-Anteils */
|
||||
protected float $cyan;
|
||||
/** @var float : Definition des Magenta-Anteil */
|
||||
/** @var float : Definition des Magenta-Anteils */
|
||||
protected float $magenta;
|
||||
/** @var float : Definition des Gelbanteil */
|
||||
/** @var float : Definition des Gelbanteils */
|
||||
protected float $yellow;
|
||||
/** @var float : Definition des Schwarzanteil */
|
||||
protected float $key;
|
||||
@@ -30,7 +30,7 @@ class CyanMagentaYellowKeyToHueSaturationValue
|
||||
protected float $minCmyProperty;
|
||||
|
||||
// Daten für HSV
|
||||
/** @var float : Definition des Farbton als Anteil eines Vollkreises '$Hue * π' */
|
||||
/** @var float : Definition des Farbtones als Anteil eines Vollkreises '$Hue * π' */
|
||||
protected float $hue = 0.0;
|
||||
/** @var float : Definition der Sättigung der Farbe */
|
||||
protected float $saturation = 0.0;
|
||||
@@ -77,7 +77,7 @@ class CyanMagentaYellowKeyToHueSaturationValue
|
||||
protected function buildHueAmount(): float
|
||||
{
|
||||
// Wenn beide Werte gleich sind, ist die Endfarbe Grau.
|
||||
// Damit wird auch in {@sse hueAmount()} eine Division durch Null verhindert.
|
||||
// Damit wird auch in {@sse hueAmount()} eine Division durch '0' verhindert.
|
||||
if ($this->maxCmyProperty === $this->minCmyProperty) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -9,11 +9,11 @@ use TorstenHettstedt\Colors\ColorModels\CyanMagentaYellowKey;
|
||||
class HueSaturationValueToCyanMagentaYellowKey extends AbstractHueSaturationValueToUtility
|
||||
{
|
||||
// Daten für CMYK
|
||||
/** @var float : Definition des Cyan-Anteil */
|
||||
/** @var float : Definition des Cyan-Anteils */
|
||||
protected float $cyan = 0.0;
|
||||
/** @var float : Definition des Magenta-Anteil */
|
||||
/** @var float : Definition des Magenta-Anteils */
|
||||
protected float $magenta = 0.0;
|
||||
/** @var float : Definition des Gelbanteil */
|
||||
/** @var float : Definition des Gelbanteils */
|
||||
protected float $yellow = 0.0;
|
||||
/** @var float : Definition des Schwarzanteil */
|
||||
protected float $key = 0.0;
|
||||
|
||||
@@ -9,11 +9,11 @@ use TorstenHettstedt\Colors\ColorModels\RedGreenBlue;
|
||||
class HueSaturationValueToRedGreenBlue extends AbstractHueSaturationValueToUtility
|
||||
{
|
||||
// Daten für RGB
|
||||
/** @var float : Definition des Rotanteil */
|
||||
/** @var float : Definition des Rotanteils */
|
||||
protected float $red = 1.0;
|
||||
/** @var float : Definition des Grünanteil */
|
||||
/** @var float : Definition des Grünanteils */
|
||||
protected float $green = 1.0;
|
||||
/** @var float : Definition des Blauanteil */
|
||||
/** @var float : Definition des Blauanteils */
|
||||
protected float $blue = 1.0;
|
||||
|
||||
public function convert(): RedGreenBlue
|
||||
@@ -37,7 +37,7 @@ class HueSaturationValueToRedGreenBlue extends AbstractHueSaturationValueToUtili
|
||||
{
|
||||
// ID des zu nutzenden Interval
|
||||
$interval_id = $this->hueAsPercentGrad / self::INTERVAL;
|
||||
// Ist der Wert der entgegen gesetzten Farbe.
|
||||
// der Wert der entgegen gesetzten Farbe
|
||||
$opposite_color_value = $this->value * ( 1 - $this->saturation);
|
||||
|
||||
switch ((int)$interval_id) {
|
||||
|
||||
@@ -13,11 +13,11 @@ class RedGreenBlueToHueSaturationValue
|
||||
const PROPERTY_BLUE = 'blue';
|
||||
|
||||
// Daten für RGB
|
||||
/** @var float : Definition des Rotanteil */
|
||||
/** @var float : Definition des Rot-Anteils */
|
||||
protected float $red;
|
||||
/** @var float : Definition des Grünanteil */
|
||||
/** @var float : Definition des Grün-Anteils */
|
||||
protected float $green;
|
||||
/** @var float : Definition des Blauanteil */
|
||||
/** @var float : Definition des Blau-Anteils */
|
||||
protected float $blu;
|
||||
|
||||
/** @var float : Der größte RGB-Farbwert */
|
||||
@@ -26,7 +26,7 @@ class RedGreenBlueToHueSaturationValue
|
||||
protected float $minRgbProperty;
|
||||
|
||||
// Daten für HSV
|
||||
/** @var float : Definition des Farbton als Anteil eines Vollkreises '$Hue * π' */
|
||||
/** @var float : Definition des Farbtones als Anteil eines Vollkreises '$Hue * π' */
|
||||
protected float $hue = 0.0;
|
||||
/** @var float : Definition der Sättigung der Farbe */
|
||||
protected float $saturation = 0.0;
|
||||
@@ -75,7 +75,7 @@ class RedGreenBlueToHueSaturationValue
|
||||
protected function buildHueAmount(): float
|
||||
{
|
||||
// Wenn beide Werte gleich sind, ist die Endfarbe Grau.
|
||||
// Damit wird auch in {@sse hueAmount()} eine Division durch Null verhindert.
|
||||
// Damit wird auch in {@sse hueAmount()} eine Division durch '0' verhindert.
|
||||
if ($this->maxRgbProperty === $this->minRgbProperty) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class ValidColorValuesProvider
|
||||
const HSV = 'hsv';
|
||||
|
||||
/**
|
||||
* @var array<string, array<string, float>[]>
|
||||
* @var array<string, array<array<string, float>>>
|
||||
*/
|
||||
protected array $definitions = [
|
||||
'weiß' => [
|
||||
@@ -308,7 +308,7 @@ class ValidColorValuesProvider
|
||||
/**
|
||||
* @param array<string> $order
|
||||
*
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function getValidColorValues(array $order): array
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ class ValidNaturallyColorValuesProvider
|
||||
const HSV = 'hsv';
|
||||
|
||||
/**
|
||||
* @var array<string, array<string, float>[]>
|
||||
* @var array<string, array<array<string, float>>>
|
||||
*/
|
||||
protected array $definitions = [
|
||||
'weiß' => [
|
||||
@@ -111,7 +111,7 @@ class ValidNaturallyColorValuesProvider
|
||||
* @param string $pure_color
|
||||
* @param string $test_color
|
||||
*
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function getValidColorValues(string $pure_color, string $test_color): array
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ class CyanMagentaYellowKeyTransformerTest extends Unit
|
||||
protected CyanMagentaYellowKey $color;
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validRgbValuesProvider(): array
|
||||
{
|
||||
@@ -25,7 +25,7 @@ class CyanMagentaYellowKeyTransformerTest extends Unit
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validHsvValuesProvider(): array
|
||||
{
|
||||
@@ -36,7 +36,7 @@ class CyanMagentaYellowKeyTransformerTest extends Unit
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validCmykValuesProvider(): array
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ class HueSaturationValueTransformerTest extends Unit
|
||||
protected HueSaturationValue $color;
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validCmykValuesProvider(): array
|
||||
{
|
||||
@@ -25,7 +25,7 @@ class HueSaturationValueTransformerTest extends Unit
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validRgbValuesProvider(): array
|
||||
{
|
||||
@@ -36,7 +36,7 @@ class HueSaturationValueTransformerTest extends Unit
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validHsvValuesProvider(): array
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ class RedGreenBlueTransformerTest extends Unit
|
||||
protected RedGreenBlue $color;
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validCmykValuesProvider(): array
|
||||
{
|
||||
@@ -25,7 +25,7 @@ class RedGreenBlueTransformerTest extends Unit
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validHsvValuesProvider(): array
|
||||
{
|
||||
@@ -36,7 +36,7 @@ class RedGreenBlueTransformerTest extends Unit
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validRgbValuesProvider(): array
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ class CyanMagentaYellowKeyTransformerTest extends Unit
|
||||
protected CyanMagentaYellowKey $color;
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validRgbValuesProvider(): array
|
||||
{
|
||||
@@ -27,7 +27,7 @@ class CyanMagentaYellowKeyTransformerTest extends Unit
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validHsvValuesProvider(): array
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ class HueSaturationValueTransformerTest extends Unit
|
||||
protected HueSaturationValue $color;
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validCmykValuesProvider(): array
|
||||
{
|
||||
@@ -27,7 +27,7 @@ class HueSaturationValueTransformerTest extends Unit
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validRgbValuesProvider(): array
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ class RedGreenBlueTransformerTest extends Unit
|
||||
protected RedGreenBlue $color;
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validCmykValuesProvider(): array
|
||||
{
|
||||
@@ -27,7 +27,7 @@ class RedGreenBlueTransformerTest extends Unit
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, float>[]>
|
||||
* @return array<string, array<array<string, float>>>
|
||||
*/
|
||||
public function validHsvValuesProvider(): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user