R
fn

useEyeDropper

v0.0.15testeddemo

Reactive wrapper around the [EyeDropper API](https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper) for picking colors from the screen.

Example

ts
const { isSupported, sRGBHex, open } = useEyeDropper();
if (isSupported.value)
  await open();

Demo

Loading demo…

Signature

ts
export function useEyeDropper(options: UseEyeDropperOptions ={ ... }

Parameters

ParameterTypeDescription
options?UseEyeDropperOptionsOptions

Returns

UseEyeDropperReturn`isSupported`, `sRGBHex`, and `open()`