perf(TmsInstanceTicker): color関数に変更 (taiyme#283)

This commit is contained in:
taiy 2024-10-08 13:54:33 +09:00 committed by kakkokari-gtyih
parent edb2e64035
commit 095a47d63b
2 changed files with 2 additions and 4 deletions

View File

@ -60,7 +60,6 @@ export const getTickerInfo = (props: MkInstanceTickerProps): ITickerInfo => {
type ITickerColors = {
readonly '--ticker-bg': string;
readonly '--ticker-fg': string;
readonly '--ticker-bg-rgb': string;
};
const TICKER_YUV_THRESHOLD = 191 as const;
@ -81,7 +80,6 @@ export const getTickerColors = (info: ITickerInfo): ITickerColors => {
const tickerColors = {
'--ticker-fg': fgHex,
'--ticker-bg': bgHex,
'--ticker-bg-rgb': `${r}, ${g}, ${b}`,
} as const satisfies ITickerColors;
tickerColorsCache.set(bgHex, tickerColors);

View File

@ -30,8 +30,8 @@ const tickerColorsRef = computed(() => getTickerColors(tickerInfoRef.value));
overflow: clip;
display: block;
box-sizing: border-box;
background-color: var(--ticker-bg, #777777);
color: var(--ticker-fg, #ffffff);
background-color: var(--ticker-bg, #777);
color: var(--ticker-fg, #fff);
--ticker-size: 2ex;
display: grid;