Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
30 | protected static function getEvenlyDistributedColors(int $hue, int $numberOfColors): array |
||
31 | { |
||
32 | $saturationStepSize = 1/$numberOfColors; |
||
33 | $saturationStart = $saturationStepSize/2; |
||
34 | |||
35 | $colors = []; |
||
36 | |||
37 | for ($i = 0; $i<$numberOfColors; $i++) { |
||
38 | $saturation = ($saturationStart + ($i * $saturationStepSize)); |
||
39 | |||
40 | $hsv = new HsvColor($hue, $saturation, self::HSV_VALUE); |
||
41 | |||
42 | $colors[] = $hsv->toRgb(); |
||
43 | } |
||
44 | |||
45 | return $colors; |
||
46 | } |
||
47 | } |
||
48 |