Directory

← Back

color-picker

A picker for color, that can use the native input

Author

Contributors

Rating

Popularity

<100

Published on NPM Published on webcomponents.org Published on Vaadin  Directory

API & Demo

<color-picker>

What is it for?

color-picker is a picker for color for Polymer that can use the native input, too. It has the same approach like in <datetime-picker>. If the native picker is choosen and is not supported, this element use the polyfill color-picker. The <color-element> will come in place if the native picker is not available or is not explicitly wanted. The value and color-string will give you directly the css-string in the selected format.

Motivation

Internally it tests the browser, if native input-type color is supported. You can decide to use the native or the replacements during runtime. color-element can also be used separately. By default, the polyfilled version is used.

It might be useful for you to use, if you like to keep the native approach of Browsers on Mobile Devices, or you like to have a different look or you would like to have a guaranteed working color-picker. Another use case could be for example, if you want on mobile devices use the native picker, when supported, and on desktop devices this polyfill.

For that purposes the attributes native and native-on-mobile are provided.

  <datetime-picker native></datetime-picker>
  <datetime-picker native-on-mobile></datetime-picker>

How?

The component page explains, which of the attributes you can use and how. You can see there a demo, too.

Examples:

color-picker

<color-picker r="{{r}}" g="{{g}}" b="{{b}}" default="green" native="[[native]]" auto-confirm="[[autoConfirm]]"></color-picker>  
<p>
  <span> red: [[r]] </span>
  <br>
  <span> green: [[g]] </span>
  <br>
  <span> blue: [[b]] </span>  
  <br>
  <br>
  <input type="checkbox" checked="{{native::change}}">native color picker
  <br>
  <br>
  <input type="checkbox" checked="{{autoConfirm::change}}">auto confirm
</p>

Stand-alone color-element

  <color-element alpha="{{alpha}}" r="{{r}}" g="{{g}}" b="{{b}}" h="{{h}}" s="{{s}}" l="{{l}}" format="{{format}}"></color-element><br>
  <p>
    <span>format </span>
    <select id="formats" value="{{format::change}}">
      <option value="auto">auto</option>
      <option value="rgb">rgb</option>
      <option value="hex">hex</option>
      <option value="hsl">hsl</option>
    </select>
    <br>
    <input type="range" min="0" max="1" step="0.01" value="{{alpha::change}}"><span> alpha: [[alpha]] </span>
    <br>
    <input type="range" min="0" max="255" step="1" value="{{r::input}}"><span> red: [[r]] </span>
    <br>
    <input type="range" min="0" max="255" step="1" value="{{g::input}}"><span> green: [[g]] </span>
    <br>
    <input type="range" min="0" max="255" step="1" value="{{b::input}}"><span> blue: [[b]] </span>
    <br>
    <input type="range" min="0" max="359" step="1" value="{{h::input}}"><span> hue: [[h]] </span>
    <br>
    <input type="range" min="0" max="1" step="0.001" value="{{s::input}}"><span> saturation: [[s]] </span>
    <br>
    <input type="range" min="0" max="1" step="0.001" value="{{l::input}}"><span> lightness: [[l]] </span>
    <br>
  </p>

Use the polyfill or the native picker

By default it checks if color is supported for a native input. If it is not and you have set native, the polyfill will be used instead of the native input. Additionally there is the attribute native-on-mobile.

Styling

Have a look at input-picker-pattern#input-shared-style to see how to style the element.

Installation

npm install --save @fooloomanzoo/color-picker

Contribute?

Feel free to send a new issue, a commit, a pull request or just fork it!

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Dependencies

  • @fooloomanzoo/color-input#^3.0.4
  • @fooloomanzoo/input-picker-pattern#^3.0.10
  • @polymer/polymer#^3
Released
2018-11-17
Maturity
IMPORTED
License
MIT License

Compatibility

Framework
Polymer 1.0+
Polymer 3.0+
Polymer 2.0+ in 2.0.11
Browser
Browser Independent

FontAwesome Iron Iconset - Vaadin Add-on Directory

Iron iconset based on FontAwesome FontAwesome Iron Iconset - Vaadin Add-on Directory
Integration of FontAwesome and iron-icon for Vaadin #### Found a bug or have a suggestion? Report it on GitHub For bug reports, feature suggestions, or questions, please open an issue on [GitHub](https://github.com/FlowingCode/FontAwesomeIronIconset/issues). This makes it easier for us to track and respond efficiently, ensuring you get the best possible support. Your input helps us improve—thank you!
Online Demo
Author Homepage
View on GitHub
Issue tracker

FontAwesome Iron Iconset version 1.0.0
Initial release

FontAwesome Iron Iconset version 1.0.1
Add overload of create method that receives a click listener.

FontAwesome Iron Iconset version 1.0.2
New version based on FontAwesome 5.10.0

FontAwesome Iron Iconset version 1.0.3
New version based on FontAwesome 5.11.1

FontAwesome Iron Iconset version 1.0.4
New version based on FontAwesome 5.11.2

FontAwesome Iron Iconset version 2.0.0
Based on FontAwesome 5.11.2, first release supporting Vaadin 14 in NPM mode.

FontAwesome Iron Iconset version 2.0.1
Maintenance release

FontAwesome Iron Iconset version 2.0.2
Upgrade to FontAwesome 5.12.0

FontAwesome Iron Iconset version 2.0.3
New release based on FontAwesome 5.12.1

FontAwesome Iron Iconset version 2.0.4
* New release based on FontAwesome 5.13.0 * Add new icons related to COVID-19

FontAwesome Iron Iconset version 2.1.0
* Based on FontAwesome 5.13.0 * Compatible with Vaadin 14 in npm mode * Iconset published in npmjs

FontAwesome Iron Iconset version 2.1.1
* Based on [FontAwesome 5.13.1](https://github.com/FortAwesome/Font-Awesome/releases/tag/5.13.1) * Compatible with Vaadin 14 in npm mode * Iconset published in [npmjs](https://www.npmjs.com/package/@flowingcode/font-awesome-iron-iconset)

FontAwesome Iron Iconset version 2.1.2
* Based on FontAwesome 5.14.0 * Compatible with Vaadin 14 in npm mode * Iconset published in npmjs

FontAwesome Iron Iconset version 2.2.0
* Based on FontAwesome 5.15.1 * Compatible with Vaadin 14+ in npm mode * Iconset published in npmjs * Add support for Duotone icons

FontAwesome Iron Iconset version 2.2.1
### New features: * Based on FontAwesome [5.15.3](https://github.com/FortAwesome/Font-Awesome/releases/tag/5.15.3) * Iconset published in [npmjs](https://www.npmjs.com/package/@flowingcode/font-awesome-iron-iconset)

FontAwesome Iron Iconset version 2.2.2
### New features * Based on [FontAwesome 5.15.4](https://github.com/FortAwesome/Font-Awesome/releases/tag/5.15.4) * Compatible with Vaadin 14+ in npm mode * Iconset published in [npmjs](https://www.npmjs.com/package/@flowingcode/font-awesome-iron-iconset/v/2.2.2)

FontAwesome Iron Iconset version 3.0.0
### New Features * Based on [FontAwesome 6.0.0](https://github.com/FortAwesome/Font-Awesome/releases/tag/6.0.0) * Compatible with Vaadin 14+ in npm mode * Iconset published in [npmjs](https://www.npmjs.com/package/@flowingcode/font-awesome-iron-iconset/v/3.0.0)

FontAwesome Iron Iconset version 4.0.0
#### New features: - Based on FontAwesome 6.0.0 - Compatible with Vaadin 23 - Iconset published in npmjs

FontAwesome Iron Iconset version 4.1.0
#### New features: * Shrink icons slotted in vaadin-button ([#43](https://github.com/FlowingCode/FontAwesomeIronIconset/issues/43)) #### Bug fixes: * Migrate Duotone to VaadinIcon

FontAwesome Iron Iconset version 4.2.0
#### New features: * Upgrade icons to FontAwesome 6.1.2 * Use fc-iconset (based on vaadin-iconset) in order to support icon aliases * Refactor gallery (demo) as a web component

FontAwesome Iron Iconset version 5.1.0
#### New features: * Based on FontAwesome 6.1.2 * Compatible with Vaadin 24

FontAwesome Iron Iconset version 3.1.0
Rename "vaadin" as "vaadin-icon" and and add "vaadin" as alias of "vaadin-icon".

FontAwesome Iron Iconset version 4.3.1
Rename "vaadin" as "vaadin-icon" and and add "vaadin" as alias of "vaadin-icon".

FontAwesome Iron Iconset version 5.1.1
Rename "vaadin" as "vaadin-icon" and and add "vaadin" as alias of "vaadin-icon".

FontAwesome Iron Iconset version 5.2.0
Update icons to FontAwesome 6.4.0

FontAwesome Iron Iconset version 3.2.1
Update icons to FontAwesome 6.4.0

FontAwesome Iron Iconset version 4.4.1
Update icons to FontAwesome 6.4.0

FontAwesome Iron Iconset version 5.2.1
Update icons to FontAwesome 6.4.0

FontAwesome Iron Iconset version 5.2.2
Version available from maven central repository.

FontAwesome Iron Iconset version 5.3.0

Online