science-release-map / src /utils /heatmapColors.ts
Avijit Ghosh
fix the bugs
8ec5b83
raw
history blame
950 Bytes
// Shared color utilities for consistent heatmap theming
// Use exact same colors for both daily and weekly views
const EMPTY_DOT_DARK = "#374151"; // gray-600 equivalent
const EMPTY_DOT_LIGHT = "#d1d5db"; // gray-300 equivalent
export const getHeatmapTheme = (primaryColor: string) => ({
dark: [EMPTY_DOT_DARK, primaryColor],
light: [EMPTY_DOT_LIGHT, primaryColor],
});
export const getHeatmapColorIntensity = (level: number, primaryColor: string) => {
if (level === 0) {
return null; // Will use CSS classes for theme-aware empty state
}
// Use different intensities of the primary color or default green scale
const greenIntensities = ['#0e4429', '#006d32', '#26a641', '#39d353'];
return greenIntensities[Math.min(level - 1, 3)] || primaryColor;
};
export const getEmptyDotColors = () => ({
dark: EMPTY_DOT_DARK,
light: EMPTY_DOT_LIGHT,
});
export const getEmptyDotClasses = () => "bg-[#d1d5db] dark:bg-[#374151]";