1 | <?php |
||||
2 | |||||
3 | declare(strict_types=1); |
||||
4 | |||||
5 | namespace Artack\Color\Transition; |
||||
6 | |||||
7 | use Artack\Color\Color\Color; |
||||
8 | use Artack\Color\Color\HSV; |
||||
9 | use Artack\Color\Color\RGB; |
||||
10 | |||||
11 | class HSVTransition implements TransitionInterface |
||||
12 | { |
||||
13 | public static function interpolate(Color $startColor, Color $endColor, float $value, float $max): Color |
||||
14 | { |
||||
15 | $step = $value / $max; |
||||
16 | |||||
17 | $hue = $startColor->getHue() + ($endColor->getHue() - $startColor->getHue()) * $step; |
||||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
18 | $saturation = $startColor->getSaturation() + ($endColor->getSaturation() - $startColor->getSaturation()) * $step; |
||||
0 ignored issues
–
show
The method
getSaturation() does not exist on Artack\Color\Color\Color . It seems like you code against a sub-type of Artack\Color\Color\Color such as Artack\Color\Color\HSV .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
19 | $value = $startColor->getValue() + ($endColor->getValue() - $startColor->getValue()) * $step; |
||||
0 ignored issues
–
show
The method
getValue() does not exist on Artack\Color\Color\Color . It seems like you code against a sub-type of Artack\Color\Color\Color such as Artack\Color\Color\HSV .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
20 | |||||
21 | return new HSV((int) round($hue), $saturation, $value); |
||||
22 | } |
||||
23 | } |
||||
24 |