From 34aac5c6b912358a2f8080c0e4d2acb33fa7634e Mon Sep 17 00:00:00 2001 From: Yuichi Semura Date: Wed, 3 Apr 2024 23:53:40 +0900 Subject: [PATCH] bugfix --- src/components/Roulette.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/Roulette.vue b/src/components/Roulette.vue index 5df62aa..86d6d6e 100644 --- a/src/components/Roulette.vue +++ b/src/components/Roulette.vue @@ -131,7 +131,7 @@ const getParam = (name: string, url: string) => { // URLからの情報取得処理 const setParameter = () => { const query = getParam('list', location.href); - return query == null ? initList : query.split(','); + return query == null ? initList.map((v)=> v) : query.split(','); }; // 色のランダム生成 @@ -169,8 +169,12 @@ const hslMapForCylinder = (h: number) => { return `hsl(${h}, ${hslForCylinder.value})`; }; -const hslMapForTextField = (h: number) => { - return `hsl(${h}, ${hslForTextField.value})`; +const hslMapForTextField = (ind: number) => { + return ind < colorViewList.value.length + ? `hsl(${colorViewList.value[ind]}, ${hslForTextField.value})` + : darkMode.value + ? '#CCCCCC' + : '#FFFFFF'; }; const addLunch = () => { @@ -427,7 +431,7 @@ watchEffect(() => { density="compact" hide-details variant="outlined" - :bg-color="hslMapForTextField(colorViewList[index])" + :bg-color="hslMapForTextField(index)" >