1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-19 05:22:13 +03:00

Fix /rainbowme and /rainbow breaking apart utf-16 emoji

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2019-07-25 19:25:28 +01:00
parent cef67d5784
commit 657a11de83

View File

@@ -56,7 +56,7 @@ export function hueToRGB(h, s, l) {
export function textToHtmlRainbow(str) {
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);
return '<font color="#' +
r.toString(16).padStart(2, "0") +