perf(TmsInstanceTicker): color関数に変更 (taiyme#283)
This commit is contained in:
parent
edb2e64035
commit
095a47d63b
|
@ -60,7 +60,6 @@ export const getTickerInfo = (props: MkInstanceTickerProps): ITickerInfo => {
|
||||||
type ITickerColors = {
|
type ITickerColors = {
|
||||||
readonly '--ticker-bg': string;
|
readonly '--ticker-bg': string;
|
||||||
readonly '--ticker-fg': string;
|
readonly '--ticker-fg': string;
|
||||||
readonly '--ticker-bg-rgb': string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const TICKER_YUV_THRESHOLD = 191 as const;
|
const TICKER_YUV_THRESHOLD = 191 as const;
|
||||||
|
@ -81,7 +80,6 @@ export const getTickerColors = (info: ITickerInfo): ITickerColors => {
|
||||||
const tickerColors = {
|
const tickerColors = {
|
||||||
'--ticker-fg': fgHex,
|
'--ticker-fg': fgHex,
|
||||||
'--ticker-bg': bgHex,
|
'--ticker-bg': bgHex,
|
||||||
'--ticker-bg-rgb': `${r}, ${g}, ${b}`,
|
|
||||||
} as const satisfies ITickerColors;
|
} as const satisfies ITickerColors;
|
||||||
|
|
||||||
tickerColorsCache.set(bgHex, tickerColors);
|
tickerColorsCache.set(bgHex, tickerColors);
|
||||||
|
|
|
@ -30,8 +30,8 @@ const tickerColorsRef = computed(() => getTickerColors(tickerInfoRef.value));
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
display: block;
|
display: block;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: var(--ticker-bg, #777777);
|
background-color: var(--ticker-bg, #777);
|
||||||
color: var(--ticker-fg, #ffffff);
|
color: var(--ticker-fg, #fff);
|
||||||
|
|
||||||
--ticker-size: 2ex;
|
--ticker-size: 2ex;
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|
Loading…
Reference in New Issue