Compare commits
9
Commits
0.2.0
..
44314b264e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44314b264e | ||
|
|
60c10f1d70 | ||
|
|
b6b366477d | ||
|
|
9c65840172 | ||
|
|
a20355ccee | ||
|
|
6f17e57424 | ||
|
|
6ca23ee2eb | ||
|
|
99c4e0dcc1 | ||
|
|
83eab10dd7 |
+3
-1
@@ -13,4 +13,6 @@ Die Klassen haben keinen Alphakanal.
|
||||
|
||||
## Hinweise zu den Transformer-Klassen
|
||||
|
||||
Das Vorgehen der Umwandlung nimmt die Informationen von [Wikipedia - Liste der Farbräume](https://de.wikipedia.org/wiki/Liste_der_Farbr%C3%A4ume) auf.
|
||||
Das Vorgehen der Umwandlung nimmt die Informationen von
|
||||
[Wikipedia - Liste der Farbräume](https://de.wikipedia.org/wiki/Liste_der_Farbr%C3%A4ume)
|
||||
und [Die Chemie-Schule - HSV-Farbraum](https://www.chemie-schule.de/KnowHow/HSV-Farbraum) auf.
|
||||
@@ -0,0 +1,14 @@
|
||||
paths:
|
||||
tests: tests
|
||||
output: tests/_output
|
||||
data: tests/_data
|
||||
support: tests/_support
|
||||
envs: tests/_envs
|
||||
actor_suffix: Tester
|
||||
extensions:
|
||||
enabled:
|
||||
- Codeception\Extension\RunFailed
|
||||
coverage:
|
||||
enabled: true
|
||||
include:
|
||||
- src/*
|
||||
+5
-3
@@ -16,15 +16,17 @@
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"TorstenHettstedtUnitTests\\Colors\\" : "tests/unit"
|
||||
"TorstenHettstedt\\Colors\\Tests\\Unit\\" : "tests/unit",
|
||||
"TorstenHettstedt\\Colors\\Tests\\Helper\\" : "tests/_support/Helper"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": "^8.0"
|
||||
"php": "^8.0",
|
||||
"phpunit/php-code-coverage": "^9.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"codeception/codeception": "^4.1.18",
|
||||
"codeception/module-phpbrowser": "^1.0.0",
|
||||
"codeception/module-asserts": "^1.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+109
-1
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace TorstenHettstedtUnitTests\Colors\Transformer;
|
||||
namespace TorstenHettstedt\Colors\Tests\Helper;
|
||||
|
||||
|
||||
class ValidColorValuesProvider
|
||||
@@ -30,6 +30,42 @@ class ValidColorValuesProvider
|
||||
'value' => 1.0,
|
||||
],
|
||||
],
|
||||
'hellgrau' => [
|
||||
self::CMYK => [
|
||||
'cyan' => 0.0,
|
||||
'magenta' => 0.0,
|
||||
'yellow' => 0.0,
|
||||
'key' => 2.0 / 3.0,
|
||||
],
|
||||
self::RGB => [
|
||||
'red' => 1.0 / 3.0,
|
||||
'green' => 1.0 / 3.0,
|
||||
'blue' => 1.0 / 3.0,
|
||||
],
|
||||
self::HSV => [
|
||||
'hue' => 0.0,
|
||||
'saturation' => 0.0,
|
||||
'value' => 1.0 / 3.0,
|
||||
],
|
||||
],
|
||||
'dunkelgrau' => [
|
||||
self::CMYK => [
|
||||
'cyan' => 0.0,
|
||||
'magenta' => 0.0,
|
||||
'yellow' => 0.0,
|
||||
'key' => 1.0 / 3.0,
|
||||
],
|
||||
self::RGB => [
|
||||
'red' => 2.0 / 3.0,
|
||||
'green' => 2.0 / 3.0,
|
||||
'blue' => 2.0 / 3.0,
|
||||
],
|
||||
self::HSV => [
|
||||
'hue' => 0.0,
|
||||
'saturation' => 0.0,
|
||||
'value' => 2.0 / 3.0,
|
||||
],
|
||||
],
|
||||
'schwarz' => [
|
||||
self::CMYK => [
|
||||
'cyan' => 0.0,
|
||||
@@ -156,6 +192,24 @@ class ValidColorValuesProvider
|
||||
'value' => 1.0,
|
||||
],
|
||||
],
|
||||
'dunkellachs' => [
|
||||
self::CMYK => [
|
||||
'cyan' => 0.0,
|
||||
'magenta' => 0.54,
|
||||
'yellow' => 0.72,
|
||||
'key' => 0.30,
|
||||
],
|
||||
self::RGB => [
|
||||
'red' => 0.7,
|
||||
'green' => 0.3216,
|
||||
'blue' => 0.1961,
|
||||
],
|
||||
self::HSV => [
|
||||
'hue' => 0.0417,
|
||||
'saturation' => 0.72,
|
||||
'value' => 0.70,
|
||||
],
|
||||
],
|
||||
'gold' => [
|
||||
self::CMYK => [
|
||||
'cyan' => 0.0,
|
||||
@@ -174,6 +228,42 @@ class ValidColorValuesProvider
|
||||
'value' => 0.87,
|
||||
],
|
||||
],
|
||||
'grasgrün' => [
|
||||
self::CMYK => [
|
||||
'cyan' => 0.495,
|
||||
'magenta' => 0.0,
|
||||
'yellow' => 1.0,
|
||||
'key' => 0.51,
|
||||
],
|
||||
self::RGB => [
|
||||
'red' => 0.247,
|
||||
'green' => 0.490,
|
||||
'blue' => 0.0,
|
||||
],
|
||||
self::HSV => [
|
||||
'hue' => 0.2492,
|
||||
'saturation' => 1.00,
|
||||
'value' => 0.49,
|
||||
],
|
||||
],
|
||||
'aquamarin' => [
|
||||
self::CMYK => [
|
||||
'cyan' => 0.501,
|
||||
'magenta' => 0.0,
|
||||
'yellow' => 0.168,
|
||||
'key' => 0.00,
|
||||
],
|
||||
self::RGB => [
|
||||
'red' => 0.49804,
|
||||
'green' => 1.0,
|
||||
'blue' => 0.83285,
|
||||
],
|
||||
self::HSV => [
|
||||
'hue' => 0.4445,
|
||||
'saturation' => 0.50196,
|
||||
'value' => 1.0,
|
||||
],
|
||||
],
|
||||
'violet' => [
|
||||
self::CMYK => [
|
||||
'cyan' => 0.191,
|
||||
@@ -192,6 +282,24 @@ class ValidColorValuesProvider
|
||||
'value' => 0.71,
|
||||
],
|
||||
],
|
||||
'pflaume' => [
|
||||
self::CMYK => [
|
||||
'cyan' => 0.0,
|
||||
'magenta' => 0.2755,
|
||||
'yellow' => 0.0,
|
||||
'key' => 0.1335,
|
||||
],
|
||||
self::RGB => [
|
||||
'red' => 0.8667,
|
||||
'green' => 0.6274,
|
||||
'blue' => 0.8667,
|
||||
],
|
||||
self::HSV => [
|
||||
'hue' => 0.83333,
|
||||
'saturation' => 0.27601,
|
||||
'value' => 0.86666,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
public function getValidColorValues(array $order): array
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php /** @noinspection PhpArrayShapeAttributeCanBeAddedInspection */
|
||||
|
||||
|
||||
namespace TorstenHettstedtUnitTests\Colors\ColorModels;
|
||||
namespace TorstenHettstedt\Colors\Tests\Unit\ColorModels;
|
||||
|
||||
use Codeception\Test\Unit;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace TorstenHettstedtUnitTests\Colors\ColorModels;
|
||||
namespace TorstenHettstedt\Colors\Tests\Unit\ColorModels;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use TorstenHettstedt\Colors\ColorModels\CyanMagentaYellowKey;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace TorstenHettstedtUnitTests\Colors\ColorModels;
|
||||
namespace TorstenHettstedt\Colors\Tests\Unit\ColorModels;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use TorstenHettstedt\Colors\ColorModels\HueSaturationValue;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php /** @noinspection PhpArrayShapeAttributeCanBeAddedInspection */
|
||||
<?php
|
||||
|
||||
namespace TorstenHettstedtUnitTests\Colors\ColorModels;
|
||||
namespace TorstenHettstedt\Colors\Tests\Unit\ColorModels;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use TorstenHettstedt\Colors\ColorModels\RedGreenBlue;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<?php /** @noinspection PhpArrayShapeAttributeCanBeAddedInspection */
|
||||
<?php
|
||||
|
||||
namespace TorstenHettstedtUnitTests\Colors\Transformer;
|
||||
namespace TorstenHettstedt\Colors\Tests\Unit\Transformer;
|
||||
|
||||
use Codeception\Test\Unit;
|
||||
use Exception;
|
||||
use TorstenHettstedt\Colors\ColorModels\CyanMagentaYellowKey;
|
||||
use TorstenHettstedt\Colors\Tests\Helper\ValidColorValuesProvider;
|
||||
use TorstenHettstedt\Colors\Transformer\CyanMagentaYellowKeyTransformer;
|
||||
|
||||
class CyanMagentaYellowKeyTransformerTest extends Unit
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<?php /** @noinspection PhpArrayShapeAttributeCanBeAddedInspection */
|
||||
<?php
|
||||
|
||||
namespace TorstenHettstedtUnitTests\Colors\Transformer;
|
||||
namespace TorstenHettstedt\Colors\Tests\Unit\Transformer;
|
||||
|
||||
use Codeception\Test\Unit;
|
||||
use Exception;
|
||||
use TorstenHettstedt\Colors\ColorModels\HueSaturationValue;
|
||||
use TorstenHettstedt\Colors\Tests\Helper\ValidColorValuesProvider;
|
||||
use TorstenHettstedt\Colors\Transformer\HueSaturationValueTransformer;
|
||||
|
||||
class HueSaturationValueTransformerTest extends Unit
|
||||
@@ -83,14 +84,11 @@ class HueSaturationValueTransformerTest extends Unit
|
||||
|
||||
/**
|
||||
* @param array $hsv
|
||||
* @param array $cmyk
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @dataProvider validCmykValuesProvider
|
||||
*
|
||||
*/
|
||||
public function testToHueSaturationValue(array $hsv, array $cmyk)
|
||||
public function testToHueSaturationValue(array $hsv)
|
||||
{
|
||||
$this->color = $this->make(HueSaturationValue::class, $hsv);
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<?php /** @noinspection PhpArrayShapeAttributeCanBeAddedInspection */
|
||||
<?php
|
||||
|
||||
namespace TorstenHettstedtUnitTests\Colors\Transformer;
|
||||
namespace TorstenHettstedt\Colors\Tests\Unit\Transformer;
|
||||
|
||||
use Codeception\Test\Unit;
|
||||
use Exception;
|
||||
use TorstenHettstedt\Colors\ColorModels\RedGreenBlue;
|
||||
use TorstenHettstedt\Colors\Tests\Helper\ValidColorValuesProvider;
|
||||
use TorstenHettstedt\Colors\Transformer\RedGreenBlueTransformer;
|
||||
|
||||
class RedGreenBlueTransformerTest extends Unit
|
||||
|
||||
Reference in New Issue
Block a user