Skip to content

Commit

Permalink
fixes import and type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
CarelessCourage committed Feb 4, 2024
1 parent 57981e5 commit eb93a13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions packages/dye/composables/eyedropper.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { colorName } from "./colorName"
import { colorName } from './colorName'

function getColor(hex: string) {
colorName(hex)()
colorName(hex)
}

function notSupported() {
Expand All @@ -16,11 +16,14 @@ function notSupported() {
const dropper = new window.EyeDropper()

function openDropper(fn = getColor) {
dropper.open().then((result: {sRGBHex: string}) => fn(result.sRGBHex))
dropper.open().then((result: { sRGBHex: string }) => fn(result.sRGBHex))
}

export function eyeDropper(fn = getColor) {
if(notSupported()) return
try { openDropper(fn) }
catch (err) { console.log(err) }
}
if (notSupported()) return
try {
openDropper(fn)
} catch (err) {
console.log(err)
}
}
2 changes: 1 addition & 1 deletion packages/dye/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DyePicker from './components/DyePicker.vue'
import DyeWrapper from '@components/DyeWrapper.vue'
import DyeWrapper from '/components/DyeWrapper.vue'
import Pallet from './components/Pallet.vue'
import ColorCanvas from './components/Canvas/ColorCanvas.vue'
import HueCanvas from './components/Canvas/HueCanvas.vue'
Expand Down

0 comments on commit eb93a13

Please sign in to comment.