mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-15 01:01:20 +10:00
Rearchitecture for v0.4.0 (#197)
* feat: database redist support * feat: rearchitecture of database schemas, migration reset, and #180 * feat: import redists * fix: giantbomb logging bug * feat: partial user platform support + statusMessage -> message * feat: add user platform filters to store view * fix: sanitize svg uploads ... copilot suggested this I feel dirty. * feat: beginnings of platform & redist management * feat: add server side redist patching * fix: update drop-base commit * feat: import of custom platforms & file extensions * fix: redelete platform * fix: remove platform * feat: uninstall commands, new R UI * checkpoint: before migrating to nuxt v4 * update to nuxt 4 * fix: fixes for Nuxt v4 update * fix: remaining type issues * feat: initial feedback to import other kinds of versions * working commit * fix: lint * feat: redist import
This commit is contained in:
76
app/utils/colors.ts
Normal file
76
app/utils/colors.ts
Normal file
@ -0,0 +1,76 @@
|
||||
export const CHART_COLOURS = {
|
||||
// Bar colours
|
||||
red: {
|
||||
fill: "fill-red-700",
|
||||
bg: "bg-red-700",
|
||||
},
|
||||
orange: {
|
||||
fill: "fill-orange-800",
|
||||
bg: "bg-orange-800",
|
||||
},
|
||||
blue: {
|
||||
fill: "fill-blue-900",
|
||||
bg: "bg-blue-900",
|
||||
},
|
||||
|
||||
// Pie colours
|
||||
lightblue: {
|
||||
fill: "fill-blue-400",
|
||||
bg: "bg-blue-400",
|
||||
},
|
||||
dropblue: {
|
||||
fill: "fill-blue-600",
|
||||
bg: "bg-blue-600",
|
||||
},
|
||||
green: {
|
||||
fill: "fill-green-500",
|
||||
bg: "bg-green-500",
|
||||
},
|
||||
yellow: {
|
||||
fill: "fill-yellow-800",
|
||||
bg: "bg-yellow-800",
|
||||
},
|
||||
purple: {
|
||||
fill: "fill-purple-500",
|
||||
bg: "bg-purple-500",
|
||||
},
|
||||
zinc: {
|
||||
fill: "fill-zinc-950",
|
||||
bg: "bg-zinc-950",
|
||||
},
|
||||
pink: {
|
||||
fill: "fill-pink-800",
|
||||
bg: "bg-pink-800",
|
||||
},
|
||||
|
||||
lime: {
|
||||
fill: "fill-lime-600",
|
||||
bg: "bg-lime-600",
|
||||
},
|
||||
emerald: {
|
||||
fill: "fill-emerald-500",
|
||||
bg: "bg-emerald-500",
|
||||
},
|
||||
slate: {
|
||||
fill: "fill-slate-800",
|
||||
bg: "bg-slate-800",
|
||||
},
|
||||
};
|
||||
export const PIE_COLOURS: ChartColour[] = [
|
||||
"lightblue",
|
||||
"dropblue",
|
||||
"purple",
|
||||
"emerald",
|
||||
];
|
||||
|
||||
export type ChartColour = keyof typeof CHART_COLOURS;
|
||||
|
||||
export function getBarColor(percentage: number): ChartColour {
|
||||
if (percentage <= 70) {
|
||||
return "blue";
|
||||
}
|
||||
if (percentage > 70 && percentage <= 90) {
|
||||
return "orange";
|
||||
}
|
||||
return "red";
|
||||
}
|
||||
Reference in New Issue
Block a user