Merge pull request #3248 from matrix-org/t3chguy/fix_rainbow_cmds
Fix /rainbowme and /rainbow breaking apart utf-16 emoji
This commit is contained in:
commit
c5f6ab41d2
1 changed files with 1 additions and 1 deletions
|
@ -56,7 +56,7 @@ export function hueToRGB(h, s, l) {
|
||||||
export function textToHtmlRainbow(str) {
|
export function textToHtmlRainbow(str) {
|
||||||
const frequency = 360 / str.length;
|
const frequency = 360 / str.length;
|
||||||
|
|
||||||
return str.split("").map((c, i) => {
|
return Array.from(str).map((c, i) => {
|
||||||
const [r, g, b] = hueToRGB(i * frequency, 1.0, 0.5);
|
const [r, g, b] = hueToRGB(i * frequency, 1.0, 0.5);
|
||||||
return '<font color="#' +
|
return '<font color="#' +
|
||||||
r.toString(16).padStart(2, "0") +
|
r.toString(16).padStart(2, "0") +
|
||||||
|
|
Loading…
Reference in a new issue