UPD: LED Color data in LEDsConfig
This commit is contained in:
@@ -8,9 +8,8 @@
|
|||||||
<h2 class="p-6">{{ $t('config_options.light_designer.led_mode') }}</h2>
|
<h2 class="p-6">{{ $t('config_options.light_designer.led_mode') }}</h2>
|
||||||
</ConfigSection>
|
</ConfigSection>
|
||||||
<div class="h-6" />
|
<div class="h-6" />
|
||||||
<!-- TODO: Instead of 3 color pickers, add a context select above -->
|
|
||||||
<ConfigSection :title="$t('config_options.light_designer.led_colors')" :icon-component="Palette">
|
<ConfigSection :title="$t('config_options.light_designer.led_colors')" :icon-component="Palette">
|
||||||
<PaletteInput />
|
<PaletteInput v-model="colors" />
|
||||||
</ConfigSection>
|
</ConfigSection>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
</div>
|
</div>
|
||||||
@@ -21,4 +20,21 @@ import { ScrollArea } from '@/components/ui/scroll-area/index.js'
|
|||||||
import { Lightbulb, Palette } from 'lucide-vue-next'
|
import { Lightbulb, Palette } from 'lucide-vue-next'
|
||||||
import ConfigSection from '@/components/config/ConfigSection.vue'
|
import ConfigSection from '@/components/config/ConfigSection.vue'
|
||||||
import PaletteInput from '@/components/config/pages/PaletteInput.vue'
|
import PaletteInput from '@/components/config/pages/PaletteInput.vue'
|
||||||
|
import Color from 'color'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
const colors = ref({
|
||||||
|
primary: {
|
||||||
|
key: 'config_options.light_designer.primary_color',
|
||||||
|
color: Color('#ff0000'),
|
||||||
|
},
|
||||||
|
secondary: {
|
||||||
|
key: 'config_options.light_designer.secondary_color',
|
||||||
|
color: Color('#00ff00'),
|
||||||
|
},
|
||||||
|
pointer: {
|
||||||
|
key: 'config_options.light_designer.pointer_color',
|
||||||
|
color: Color('#0000ff'),
|
||||||
|
},
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -14,23 +14,23 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import HSVInput from '@/components/HSVInput.vue'
|
import HSVInput from '@/components/HSVInput.vue'
|
||||||
import Color from 'color'
|
import Color from 'color'
|
||||||
import { reactive, ref } from 'vue'
|
import { onBeforeMount, reactive, ref } from 'vue'
|
||||||
|
|
||||||
const currentOption = ref('primary')
|
const currentOption = ref(null)
|
||||||
|
|
||||||
const model = defineModel({
|
const model = defineModel({
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({
|
default: () => ({
|
||||||
primary: {
|
one: {
|
||||||
key: 'config_options.light_designer.primary_color',
|
key: 'One',
|
||||||
color: Color('#ff0000'),
|
color: Color('#ff0000'),
|
||||||
},
|
},
|
||||||
secondary: {
|
two: {
|
||||||
key: 'config_options.light_designer.secondary_color',
|
key: 'Two',
|
||||||
color: Color('#00ff00'),
|
color: Color('#00ff00'),
|
||||||
},
|
},
|
||||||
pointer: {
|
three: {
|
||||||
key: 'config_options.light_designer.pointer_color',
|
key: 'Three',
|
||||||
color: Color('#0000ff'),
|
color: Color('#0000ff'),
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@@ -38,4 +38,9 @@ const model = defineModel({
|
|||||||
|
|
||||||
const options = reactive(model.value)
|
const options = reactive(model.value)
|
||||||
|
|
||||||
|
onBeforeMount(() => {
|
||||||
|
if (currentOption.value === null)
|
||||||
|
currentOption.value = Object.keys(options)[0]
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user