Skip to content
This repository has been archived by the owner on Dec 7, 2024. It is now read-only.

Commit

Permalink
Use data-mx-color for rainbows
Browse files Browse the repository at this point in the history
The font tag may be deprecated soon (matrix-org/matrix-spec#1739)

Signed-off-by: Tulir Asokan <tulir@maunium.net>
  • Loading branch information
tulir committed Mar 7, 2024
1 parent 148520c commit f257185
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/colour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export function textToHtmlRainbow(str: string): string {
const [a, b] = generateAB(i * frequency, 1);
const [red, green, blue] = labToRGB(75, a, b);
return (
'<font color="#' +
'<span data-mx-color="#' +
red.toString(16).padStart(2, "0") +
green.toString(16).padStart(2, "0") +
blue.toString(16).padStart(2, "0") +
'">' +
c +
"</font>"
"</span>"
);
})
.join("");
Expand Down

0 comments on commit f257185

Please sign in to comment.