1.0.10 • Published 4 years ago

color-picker-element v1.0.10

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

color-picker

color-picker is a custom Element powered by @bgins TinyColor library.

  • Supports hex, rgb(a), rrggbbaa/hex8, hsl(a) and hsv/b(a) color schemes.
  • Fully keyboard accessible

Tested browsers (older / other browsers may work)

  • Chrome >= 67
  • Firefox >= 63
  • Safari >= 10.1
  • IE11+

screenshot.gif

<color-picker
  id="picker"
  value="#ff0000"
  formats="hex,rgb,hsl,hsv,hex8"
  selectedformat="hex"
></color-picker>
picker.addEventlistener('input', (e) => console.info('input', e.detail.value))
picker.addEventlistener('change', (e) => console.info('change', e.detail.value))

Attributes

AttributeTypeDescription
darkBooleanForce dark mode when dark-mode is disabled in browser.
lightBooleanForce light mode when dark-mode is enabled in browser.
selectedformatString

Properties

PropertyAttributeModifiersTypeDefaultDescription
alpha
colorreadonly
formatsformatsArray"hex","hex8","rgb","hsv","hsl"list of visible color schemes
hexreadonly
hex8readonly
hslreadonly
hsvreadonly
rgbreadonly
selectedFormatselectedFormatString"rgb"selected color scheme
supportedFormatsreadonlystring[]
valuevalueString{"h":0,"s":1,"v":1}color value

Events

Event
change
input

CSS Custom Properties

PropertyDescription
--color-picker-background-colorbackround color
--color-picker-colortext color
1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.9.0

5 years ago

0.11.4

5 years ago

0.11.3

5 years ago

0.11.2

5 years ago

0.11.0

5 years ago

0.11.1

5 years ago

0.10.6

5 years ago

0.10.5

5 years ago

0.10.4

5 years ago

0.10.3

5 years ago

0.9.6

5 years ago

0.10.0

5 years ago

0.10.1

5 years ago

0.10.2

5 years ago

0.9.5

5 years ago

0.9.4

5 years ago

0.9.3

5 years ago

0.9.1

5 years ago