Skip to content

Commit

Permalink
2.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gka committed Feb 3, 2022
1 parent 93af49d commit cd1b3c0
Show file tree
Hide file tree
Showing 10 changed files with 330 additions and 162 deletions.
33 changes: 21 additions & 12 deletions chroma-light.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
};

chroma$7.Color = Color_1;
chroma$7.version = '2.4.1';
chroma$7.version = '2.4.2';

var chroma_1 = chroma$7;

Expand Down Expand Up @@ -979,13 +979,13 @@

var Color$6 = Color_1;

Color$6.prototype.get = function(mc) {
Color$6.prototype.get = function (mc) {
var ref = mc.split('.');
var mode = ref[0];
var channel = ref[1];
var src = this[mode]();
if (channel) {
var i = mode.indexOf(channel);
var i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);
if (i > -1) { return src[i]; }
throw new Error(("unknown channel " + channel + " in mode " + mode));
} else {
Expand Down Expand Up @@ -1033,23 +1033,32 @@
var Color$3 = Color_1;
var type = utils.type;

Color$3.prototype.set = function(mc, value, mutate) {
if ( mutate === void 0 ) mutate=false;
Color$3.prototype.set = function (mc, value, mutate) {
if ( mutate === void 0 ) mutate = false;

var ref = mc.split('.');
var mode = ref[0];
var channel = ref[1];
var src = this[mode]();
if (channel) {
var i = mode.indexOf(channel);
var i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);
if (i > -1) {
if (type(value) == 'string') {
switch(value.charAt(0)) {
case '+': src[i] += +value; break;
case '-': src[i] += +value; break;
case '*': src[i] *= +(value.substr(1)); break;
case '/': src[i] /= +(value.substr(1)); break;
default: src[i] = +value;
switch (value.charAt(0)) {
case '+':
src[i] += +value;
break;
case '-':
src[i] += +value;
break;
case '*':
src[i] *= +value.substr(1);
break;
case '/':
src[i] /= +value.substr(1);
break;
default:
src[i] = +value;
}
} else if (type(value) === 'number') {
src[i] = value;
Expand Down
2 changes: 1 addition & 1 deletion chroma-light.min.js

Large diffs are not rendered by default.

33 changes: 21 additions & 12 deletions chroma.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
};

chroma$k.Color = Color_1;
chroma$k.version = '2.4.1';
chroma$k.version = '2.4.2';

var chroma_1 = chroma$k;

Expand Down Expand Up @@ -2034,13 +2034,13 @@

var Color$j = Color_1;

Color$j.prototype.get = function(mc) {
Color$j.prototype.get = function (mc) {
var ref = mc.split('.');
var mode = ref[0];
var channel = ref[1];
var src = this[mode]();
if (channel) {
var i = mode.indexOf(channel);
var i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);
if (i > -1) { return src[i]; }
throw new Error(("unknown channel " + channel + " in mode " + mode));
} else {
Expand Down Expand Up @@ -2175,23 +2175,32 @@
var Color$d = Color_1;
var type$3 = utils.type;

Color$d.prototype.set = function(mc, value, mutate) {
if ( mutate === void 0 ) mutate=false;
Color$d.prototype.set = function (mc, value, mutate) {
if ( mutate === void 0 ) mutate = false;

var ref = mc.split('.');
var mode = ref[0];
var channel = ref[1];
var src = this[mode]();
if (channel) {
var i = mode.indexOf(channel);
var i = mode.indexOf(channel) - (mode.substr(0, 2) === 'ok' ? 2 : 0);
if (i > -1) {
if (type$3(value) == 'string') {
switch(value.charAt(0)) {
case '+': src[i] += +value; break;
case '-': src[i] += +value; break;
case '*': src[i] *= +(value.substr(1)); break;
case '/': src[i] /= +(value.substr(1)); break;
default: src[i] = +value;
switch (value.charAt(0)) {
case '+':
src[i] += +value;
break;
case '-':
src[i] += +value;
break;
case '*':
src[i] *= +value.substr(1);
break;
case '/':
src[i] /= +value.substr(1);
break;
default:
src[i] = +value;
}
} else if (type$3(value) === 'number') {
src[i] = value;
Expand Down
2 changes: 1 addition & 1 deletion chroma.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit cd1b3c0

Please sign in to comment.