MCPcopy Create free account
hub / github.com/Thanas-R/Virdis / getSeasonColor

Function getSeasonColor

src/components/CropPlanningSection.tsx:1119–1125  ·  view source on GitHub ↗
(season: string)

Source from the content-addressed store, hash-verified

1117 Winter: "#3B82F6",
1118 Fall: "#F97316",
1119};
1120
1121function getSeasonColor(season: string): string {
1122 for (const [key, color] of Object.entries(SEASON_COLORS)) {
1123 if (season.toLowerCase().includes(key.toLowerCase())) return color;
1124 }
1125 const hash = season.split("").reduce((sum, char) => sum + char.charCodeAt(0), 0);
1126 return `hsl(${hash % 360}, 55%, 50%)`;
1127}
1128

Callers 1

CropPlanningSectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected