support EyeDropper API in color picker
Chrome 95+ https://wicg.github.io/eyedropper-api/
This commit is contained in:
parent
997f1fe8de
commit
cf0ecbfd4a
BIN
images/eyedropper/16px.png
Normal file
BIN
images/eyedropper/16px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 275 B |
BIN
images/eyedropper/32px.png
Normal file
BIN
images/eyedropper/32px.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 376 B |
3
images/eyedropper/README.md
Normal file
3
images/eyedropper/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
Author: DesignContest
|
||||
License: https://creativecommons.org/licenses/by/4.0/
|
||||
Source: https://iconarchive.com/show/outline-icons-by-designcontest/Eyedropper-icon.html
|
|
@ -377,6 +377,15 @@
|
|||
color: var(--label-color-hover);
|
||||
}
|
||||
|
||||
.colorpicker-dropper {
|
||||
position: absolute;
|
||||
right: 7px;
|
||||
bottom: 4px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.colorpicker-palette:not(:empty) {
|
||||
--swatch-size: 16px;
|
||||
margin: 0 var(--margin) var(--margin);
|
||||
|
|
|
@ -167,6 +167,12 @@
|
|||
$('format-change', [
|
||||
$formatChangeButton = $('format-change-button', {onclick: setFromFormatElement}, '↔'),
|
||||
]),
|
||||
window.EyeDropper &&
|
||||
$('dropper', {
|
||||
tag: 'img',
|
||||
onclick: () => new window.EyeDropper().open().then(r => setFromColor(r.sRGBHex), () => 0),
|
||||
srcset: '/images/eyedropper/16px.png, /images/eyedropper/32px.png 2x',
|
||||
}),
|
||||
]),
|
||||
$palette = $('palette', {
|
||||
onclick: onPaletteClicked,
|
||||
|
|
Loading…
Reference in New Issue
Block a user