[犀牛鸟]feat(ColorPicker): support eyedropper color picking - #6796
Open
LiamFan16-mikasa wants to merge 4 commits into
Open
[犀牛鸟]feat(ColorPicker): support eyedropper color picking#6796LiamFan16-mikasa wants to merge 4 commits into
LiamFan16-mikasa wants to merge 4 commits into
Conversation
LiamFan16-mikasa
requested review from
Cat1007,
PengYYYYY,
Wesley-0808,
chaishi,
liweijie0812,
uyarn,
zhangpaopao0609 and
zydemail
as code owners
July 10, 2026 07:08
LiamFan16-mikasa
force-pushed
the
feat/color-picker-eyedropper
branch
from
July 10, 2026 07:29
738c732 to
e4b4e83
Compare
16 tasks
Open
15 tasks
Collaborator
|
/update-common 2624 |
Collaborator
TDesign Component Site Preview Open
|
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
closes Tencent/tdesign-common#2568
配套 PR:
💡 需求背景和解决方案
要解决的问题:用户需要直接从屏幕取色(如上传背景图后取图中颜色调整页面背景),现有 ColorPicker 只能手动调整面板(详见 issue)。
API 设计:新增
eyeDropper属性(Boolean,默认false,ColorPicker与ColorPickerPanel均支持)。开启后面板顶部显示吸色按钮,基于浏览器原生 EyeDropper API;onChange的context.trigger新增'eyedropper'。实现要点:
tdesign-icons-vue-next的SipIcon(经useGlobalIcon,支持全局图标替换),样式复用 common 侧t-color-picker__eyedropper类(feat(color-picker): add eyedropper utility and styles tdesign-common#2624)t-is-disabled+ 原生disabled)而非隐藏,用户可感知功能存在;colorModes仅单模式时按钮仍正常显示Color.update()既有路径:单色模式更新整体颜色,渐变模式仅更新当前选中的渐变节点(与输入框行为一致,不会把渐变覆盖为单色)enableAlpha时保留吸色前的透明度(EyeDropper 只返回不透明 hex,透明度只由 alpha 滑条控制)AbortSignal中断进行中的取色;用户 Esc 取消不触发 change、无报错utils/eyedropper.ts),与 feat(color-picker): add eyedropper utility and styles tdesign-common#2624 的js/color-picker/eyedropper.ts完全同 API,该 PR 合并、submodule 更新后可一行切换为公共导入交互效果:
因吸色盘在gif图中未被截取,故附截图辅助显示效果

📝 更新日志
tdesign-vue-next
eyeDropper属性,支持使用浏览器原生 EyeDropper API 从屏幕吸色@tdesign-vue-next/chat
@tdesign-vue-next/nuxt
@tdesign-vue-next/auto-import-resolver
☑️ 请求合并前的自查清单