feat(color-picker): add EyeDropper API support for color sampling - #2615
Open
Lfan-ke wants to merge 1 commit into
Open
feat(color-picker): add EyeDropper API support for color sampling#2615Lfan-ke wants to merge 1 commit into
Lfan-ke wants to merge 1 commit into
Conversation
Lfan-ke
force-pushed
the
feat/color-picker-eyedropper
branch
from
July 7, 2026 10:55
aab535b to
dbc6fe2
Compare
Signed-off-by: 林晨 (Leo Cheng) <leo-cheng@vip.qq.com>
Lfan-ke
force-pushed
the
feat/color-picker-eyedropper
branch
from
July 7, 2026 12:12
dbc6fe2 to
dc7710d
Compare
16 tasks
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.
关联 Issue
closes #2568
变更内容
在
js/color-picker/下新增eyedropper.ts模块,封装浏览器原生 EyeDropper API,向上游框架(Vue / React / 小程序等)提供统一的吸色能力:isEyeDropperSupported()- 运行时能力检测,通过globalThis.EyeDropper判断(兼容 SSR/Node 环境)openEyeDropper(signal?)- 调起系统吸色器,返回用户选中的十六进制颜色值;用户取消或发生错误均返回nullAbortSignal,可在组件卸载时中断进行中的取色EyeDropperResult/EyeDropperOpenOptions接口,供框架层类型复用测试
新增
test/unit/color-picker/eyedropper.test.ts,9 个用例,覆盖:globalThis.EyeDropper)返回false/nullnull框架侧实现
本 PR 为公共工具层,三个框架侧 PR 均依赖此模块: