File size: 422 Bytes
82395a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr

def handler(in1):    
    return in1

in1=gr.ColorPicker(
    value='#FF5733',       # 預設顏色
    label='請選擇顏色',     # 元件標籤
    info='請按底下色塊'     # 說明
    )
out1=gr.Textbox(label='選擇的顏色')

iface=gr.Interface(
    fn=handler,
    inputs=[in1], 
    outputs=[out1],
    title='ColorPicker 元件測試',
    flagging_mode='never',
    )

iface.launch()