Use data-mx-color for rainbows (#12325)
* Use data-mx-color for rainbows The font tag may be deprecated soon (https://github.com/matrix-org/matrix-spec/pull/1739) Signed-off-by: Tulir Asokan <tulir@maunium.net> * Update tests Signed-off-by: Tulir Asokan <tulir@maunium.net> --------- Signed-off-by: Tulir Asokan <tulir@maunium.net>
This commit is contained in:
parent
665605b2b6
commit
79c50db009
3 changed files with 6 additions and 6 deletions
|
@ -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("");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue