1import { Color, ColorPicker, Navigation, NavigationStack, Script, Text, useState, VStack } from "scripting"
2
3function Example() {
4 const [value, setValue] = useState<Color>('blue')
5
6 return <NavigationStack>
7 <VStack
8 navigationTitle={"Color Picker"}
9 navigationBarTitleDisplayMode={"inline"}
10 >
11 <ColorPicker
12 value={value}
13 onChanged={setValue}
14 >
15 <Text>Current color: {value}</Text>
16 </ColorPicker>
17 </VStack>
18 </NavigationStack>
19}
20
21async function run() {
22 await Navigation.present({
23 element: <Example />
24 })
25
26 Script.exit()
27}
28
29run()