// A stable, pleasant hue per string (genre/playlist/collection title) plus the matching tile gradient. // Shared by the Discover genre tiles (PlexDiscover) and the header Playlist/Collection browse tiles // (plexBrowseLists) so the two surfaces that are meant to look identical can't drift. Hashing keeps a // name the same color across renders/sessions without storing anything. export function hueOf(name: string): number { let h = 0; for (let i = 0; i < name.length; i++) h = (h * 31 + name.charCodeAt(i)) % 360; return h; } export function hueTileGradient(hue: number): string { return `linear-gradient(135deg, hsl(${hue} 55% 32%), hsl(${(hue + 40) % 360} 60% 22%))`; }