31 lines
711 B
TypeScript
31 lines
711 B
TypeScript
import { ICONS, PRESTIGES } from "@/data/hypixel/skywars"
|
|
import { floorLevel } from "./formatters"
|
|
|
|
export function getTextColor(level: number) {
|
|
const floored = floorLevel(level, 5)
|
|
|
|
if (level > 150) {
|
|
return {
|
|
text: PRESTIGES.at(-1)?.color ?? "gray",
|
|
brackets: PRESTIGES.at(-1)?.b_color ?? "gray"
|
|
}
|
|
}
|
|
|
|
const pres = PRESTIGES.find(p => p.level === floored)
|
|
|
|
return {
|
|
text: pres?.color ?? "gray",
|
|
brackets: pres?.b_color ?? "gray"
|
|
}
|
|
}
|
|
|
|
export function getSkyWarsIcon(icon?: string) {
|
|
if (!icon) {
|
|
return ICONS.default
|
|
}
|
|
|
|
const icons = ICONS as Record<string, string>
|
|
|
|
return icons[icon] ?? ICONS.default
|
|
}
|