color-input | Vaadin

an input for color values

Published on NPM Published on

API & Demo


An input for color. It can use the formats rgb, hsl or hex. Additionally you can use text for automatically transform a color-string like red to its rgb-representation. If you are looking for a picker for color, please have a look at color-picker.


<span>color-input: </span><color-input value="{{color}}" alpha="{{alpha}}" r="{{r}}" g="{{g}}" b="{{b}}" h="{{h}}" s="{{s}}" l="{{l}}" format="{{format}}"></color-input>
<span>color-text-input: </span><color-text-input value="{{color}}" alpha="{{alpha}}" format="{{format}}"></color-text-input>
  <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>
  <input type="range" min="0" max="1" step="0.01" value="{{alpha::change}}"><span> alpha: [[alpha]] </span>
  <input type="range" min="0" max="255" step="1" value="{{r::input}}"><span> red: [[r]] </span>
  <input type="range" min="0" max="255" step="1" value="{{g::input}}"><span> green: [[g]] </span>
  <input type="range" min="0" max="255" step="1" value="{{b::input}}"><span> blue: [[b]] </span>
  <input type="range" min="0" max="359" step="1" value="{{h::input}}"><span> hue: [[h]] </span>
  <input type="range" min="0" max="1" step="0.001" value="{{s::input}}"><span> saturation: [[s]] </span>
  <input type="range" min="0" max="1" step="0.001" value="{{l::input}}"><span> lightness: [[l]] </span>


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


npm i --save @fooloomanzoo/color-input




Link to this version
ImportedReleased 17 November 2018MIT License
Framework Support
Polymer 3.0+
Browser Independent
Install with
npm install @fooloomanzoo/color-input"@3.0.4"
Run the above npm command in your project folder. If you have any issues installing, please contact the author.
Release notes - Version 3.0.4


  • @fooloomanzoo/input-picker-pattern#^3.0.10
  • @fooloomanzoo/number-input#^3.0.10
  • @fooloomanzoo/property-mixins#^3.0.10
  • @fooloomanzoo/text-input#^3.0.8
  • @polymer/polymer#^3