Skip to content

Commit

Permalink
added hooks for hex color space
Browse files Browse the repository at this point in the history
  • Loading branch information
gka committed Dec 10, 2018
1 parent 52389b2 commit 3fee035
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/io/hex/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const chroma = require('../../chroma');
const Color = require('../../Color');
const input = require('../input');
const rgb2hex = require('./rgb2hex');

Color.prototype.hex = function(mode) {
return rgb2hex(this._rgb, mode);
};

input.hex = require('./hex2rgb');
chroma.hex = (...args) => new Color(...args, 'hex');

0 comments on commit 3fee035

Please sign in to comment.