From 2a9dc51a5deb4153a40ffbab643ea21e414bbdd6 Mon Sep 17 00:00:00 2001 From: ajdj100 Date: Fri, 28 Nov 2025 00:41:50 -0500 Subject: [PATCH] overhauled color selection system --- .../calendar/CreateCalendarEvent.vue | 52 +++++++++++++++++-- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/ui/src/components/calendar/CreateCalendarEvent.vue b/ui/src/components/calendar/CreateCalendarEvent.vue index 5da5e51..75d8996 100644 --- a/ui/src/components/calendar/CreateCalendarEvent.vue +++ b/ui/src/components/calendar/CreateCalendarEvent.vue @@ -22,6 +22,15 @@ import { import { Input } from "@/components/ui/input" import Textarea from "../ui/textarea/Textarea.vue" import { CalendarEvent } from "@shared/types/calendar" +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' @@ -95,7 +104,7 @@ function makeInitialValues() { endDate: toLocalDateString(end), endTime: toLocalTimeString(end), location: "", - color: "#3b82f6", + color: "#6890ee", description: "", id: null as number | null, } @@ -144,6 +153,18 @@ const emit = defineEmits<{ (e: 'reload'): void }>() const formRef = ref(null); + +const colorOptions = [ + { name: "Blue", hex: "#6890ee" }, + { name: "Purple", hex: "#a25fce" }, + { name: "Orange", hex: "#fba037" }, + { name: "Green", hex: "#6cd265" }, + { name: "Red", hex: "#ff5959" }, +]; + +function getColorName(hex: string) { + return colorOptions.find(c => c.hex === hex)?.name ?? hex +}