The page color picker implemented by js only, just create an instance on the required page, Then call the open
method when using
Link: https://songlh.top/page-color-picker/
Because not uploaded to npm, it needs to be built in packages/page-color-picker
git clone https://github.com/LHRUN/page-color-picker.git
cd page-color-picker
pnpm install
cd packages/page-color-picker
pnpm run build
cp -r dist "<folder>"
and import
import { ColorPicker } from "<folder>/dist/index.js"
name | desc | type | defaultValue |
---|---|---|---|
onChange |
mouse click callback | (color: string) => void | undefined |
name | desc | type |
---|---|---|
open |
open color picker | () => void |
git clone https://github.com/LHRUN/page-color-picker.git
cd page-color-picker
pnpm install
cd packages/examples
pnpm run dev
├─ packages
│ ├─ examples
│ └─ page-color-picker
│ ├─index.ts // ColorPicker class
│ └─utils
│ ├─constant
│ ├─tools
│ └─types
│
// ...