Skip to content

Instantly share code, notes, and snippets.

@drmzio
Created March 13, 2014 02:14
Show Gist options
  • Select an option

  • Save drmzio/9520763 to your computer and use it in GitHub Desktop.

Select an option

Save drmzio/9520763 to your computer and use it in GitHub Desktop.
A Pen by Daniel Ramirez.
<input type="color" id="colorGrab">
<div id="id">Choose a color and click refresh</div>
<button id="refresh">Refresh</button>
var colorId = document.getElementById('colorGrab');
var outputId = document.getElementById('id');
var refresh = document.getElementById('refresh');
refresh.addEventListener('click', function() {
outputId.innerHTML = 'HEX Value: ' + colorId.value;
});

Simple HEX color generator

Don't know the HEX value of a certain color? Well, choose a color in the HTML5 color picker and click refresh to generate that color's HEX value!

A Pen by Daniel Ramirez on CodePen.

License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment