This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateFlagHTML(text) { | |
// Convert text to hex | |
const hex = Array.from(text) | |
.map(c => c.charCodeAt(0).toString(16).padStart(2, '0')) | |
.join(''); | |
// Pad hex string to multiple of 6 (RGB triplet) | |
const paddedHex = hex.padEnd(Math.ceil(hex.length / 6) * 6, '0'); | |
// Chunk into RGB hex triplets |
OlderNewer