Skip to content

Commit

Permalink
feat: Add ColorSchemeGenerator for dynamic color s
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Mar 12, 2024
1 parent 8f9552e commit 539c1d5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Utils/ColorSchemeGenerator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace src\Utils;

class ColorSchemeGenerator {
public static function generate($numColors) {
if ($numColors < 1) {
return [];
}
$colors = [];
for ($i = 0; $i < $numColors; $i++) {
$hue = ($i * 360 / $numColors) % 360;
$colors[] = "hsl(" . $hue . ", 100%, 50%)";
}
return $colors;
}
}

0 comments on commit 539c1d5

Please sign in to comment.