This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ColorSteps = (() => { | |
/** | |
* Convert any color string to an [r,g,b,a] array. | |
* @author Arjan Haverkamp (arjan-at-avoid-dot-org) | |
* @param {string} color Any color. F.e.: 'red', '#f0f', '#ff00ff', 'rgb(x,y,x)', 'rgba(r,g,b,a)', 'hsl(180, 50%, 50%)' | |
* @returns {array} [r,g,b,a] array. Caution: returns [0,0,0,0] for invalid color. | |
* @see https://gist.github.com/av01d/8f068dd43447b475dec4aad0a6107288 | |
*/ | |
const colorValues = color => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const commands = { | |
'ctrl+z' => History.undo, | |
'ctrl+y' => History.redo, | |
'escape': () => { alert('esc'); } | |
}; | |
$(window).on('keydown', event => { | |
let label = ''; | |
if (event.ctrlKey) { label += 'ctrl+'; } | |
if (event.altKey) { label += 'alt+'; } |
OlderNewer