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\RGB; |
||||
9 | |||||
10 | class RGBTransition implements TransitionInterface |
||||
11 | { |
||||
12 | public static function interpolate(Color $startColor, Color $endColor, float $value, float $max): Color |
||||
13 | { |
||||
14 | $step = $value / $max; |
||||
15 | |||||
16 | $red = $startColor->getRed() + ($endColor->getRed() - $startColor->getRed()) * $step; |
||||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
17 | $green = $startColor->getGreen() + ($endColor->getGreen() - $startColor->getGreen()) * $step; |
||||
0 ignored issues
–
show
The method
getGreen() does not exist on Artack\Color\Color\Color . It seems like you code against a sub-type of said class. However, the method does not exist in Artack\Color\Color\HSV . Are you sure you never get one of those?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
18 | $blue = $startColor->getBlue() + ($endColor->getBlue() - $startColor->getBlue()) * $step; |
||||
0 ignored issues
–
show
The method
getBlue() does not exist on Artack\Color\Color\Color . It seems like you code against a sub-type of said class. However, the method does not exist in Artack\Color\Color\HSV . Are you sure you never get one of those?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
19 | |||||
20 | return new RGB((int) round($red), (int) round($green), (int) round($blue)); |
||||
21 | } |
||||
22 | } |
||||
23 |