(s?: string)
| 14 | const stacks = getStacks("en"); |
| 15 | |
| 16 | const hexFromSlug = (s?: string) => { |
| 17 | if (!s) return null; |
| 18 | let hash = 0; |
| 19 | for (let i = 0; i < s.length; i++) { |
| 20 | hash = s.charCodeAt(i) + ((hash << 5) - hash); |
| 21 | } |
| 22 | const hex = "#" + ("000000" + (hash & 0xffffff).toString(16)).slice(-6); |
| 23 | return hex; |
| 24 | }; |
| 25 | |
| 26 | export const logoFromIcon = ({ slug, icon }: LogoProps) => { |
| 27 | if (!slug && !icon) return null; |