For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/zh/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/zh/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/zh/components/color-picker.md.
v0.0.57
  • 简体中文
  • ColorPicker

    数据录入@rockshin/tao-ui

    选择单色或渐变色,提供精度保留的颜色对象、预设与格式转换。

    新增 API 对齐 Ant Design 6.7.0,外观、主题与 Semantic DOM 使用 tao-ui。既有组件 API 保持原样。

    代码演示

    受控颜色

    保留 onChange 返回的 Color 对象,避免编辑过程中反复转换精度。

    #008888

    TSX

    三种尺寸

    尺寸沿用兼容 API 的 small、middle 和 large。

    TSX

    渐变与色标

    添加、删除和移动色标,或切换单色与渐变模式。

    TSX

    分组预设

    按业务颜色分组;预设也可以包含渐变。

    TSX

    HEX、RGB 与 HSB

    使用格式菜单切换表达方式,或锁定需要的格式。

    TSX

    透明度与清除

    disabledAlpha 仅提交不透明颜色;allowClear 提供透明值。

    TSX

    完成后提交

    onChangeComplete 用于拖动或输入结束后的业务提交。

    Committed: #008888

    TSX

    自定义面板

    组合 Picker 和 Presets,并保留选择器状态与事件。

    TSX

    触发器与禁用

    可使用自定义按钮、悬停触发或禁用状态。

    TSX

    手机调色板

    独立手机视口限制面板宽度,并继承暗色主题。

    390 × 640
    TSX

    API

    ColorPicker

    属性说明类型默认值
    className节点类名string | undefined-
    style节点样式CSSProperties | undefined-
    disabled是否禁用boolean | undefined-