| 62 | * @param isReversing - Whether the sheen is in the reverse (unfill) phase |
| 63 | */ |
| 64 | export function getSheenColor( |
| 65 | char: string, |
| 66 | charIndex: number, |
| 67 | sheenPosition: number, |
| 68 | logoColor: string, |
| 69 | shadowChars: Set<string>, |
| 70 | accentColor: string = '#9EFC62', |
| 71 | blockColor: string = '#ffffff', |
| 72 | isReversing: boolean = false, |
| 73 | ): string { |
| 74 | // Block characters use the specified block color |
| 75 | if (char === '█') { |
| 76 | return blockColor |
| 77 | } |
| 78 | |
| 79 | // Only apply sheen to shadow/border characters |
| 80 | if (!shadowChars.has(char)) { |
| 81 | return logoColor |
| 82 | } |
| 83 | |
| 84 | if (isReversing) { |
| 85 | // Reverse phase: characters behind the sheen return to logoColor |
| 86 | if (charIndex <= sheenPosition) { |
| 87 | return logoColor |
| 88 | } |
| 89 | // Characters ahead of the sheen stay accent color |
| 90 | return accentColor |
| 91 | } else { |
| 92 | // Forward phase: characters at or behind the sheen get the accent color |
| 93 | if (charIndex <= sheenPosition) { |
| 94 | return accentColor |
| 95 | } |
| 96 | // Characters ahead of the sheen remain original color |
| 97 | return logoColor |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * Parses the logo string into individual lines |