'use strict';

var index = require('../color/index.js');
var change = require('./change.js');

/* IMPORT */
/* MAIN */
const adjust = (color, channels) => {
    const ch = index.parse(color);
    const changes = {};
    for (const c in channels) {
        if (!channels[c])
            continue;
        changes[c] = ch[c] + channels[c];
    }
    return change(color, changes);
};

module.exports = adjust;
