MCPcopy Create free account
hub / github.com/alanagoyal/docbase / hslStringToObject

Function hslStringToObject

components/groups-form.tsx:26–36  ·  view source on GitHub ↗
(hslString: string)

Source from the content-addressed store, hash-verified

24
25// Add this helper function to convert HSL string to HslColor object
26const hslStringToObject = (hslString: string): HslColor => {
27 const match = hslString.match(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/)
28 if (match) {
29 return {
30 h: parseInt(match[1]),
31 s: parseFloat(match[2]),
32 l: parseFloat(match[3])
33 }
34 }
35 return { h: 0, s: 0, l: 0 } // Default color if parsing fails
36}
37
38export function GroupsDialog({ isOpen, onClose, userId, onGroupsChange }: GroupsDialogProps) {
39 const [groups, setGroups] = useState<Group[]>([])

Callers 1

GroupsDialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected