feat(messaging): show last read message divider

This commit is contained in:
Paul
2021-12-24 14:32:04 +00:00
parent c8b569f16f
commit d0c1deb77c
5 changed files with 25 additions and 9 deletions

View File

@@ -201,10 +201,12 @@ export default class STheme {
}
}
function getContrastingColour(hex: string, fallback = "black"): string {
function getContrastingColour(hex: string, fallback?: string): string {
if (typeof hex !== "string") return "black";
// TODO: Switch to color-parse
// Try parse hex value.
hex = hex.replace("#", "");
hex = hex.replace(/#/g, "");
const r = parseInt(hex.substr(0, 2), 16) / 255;
const g = parseInt(hex.substr(2, 2), 16) / 255;
const b = parseInt(hex.substr(4, 2), 16) / 255;