'use strict';

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

/* IMPORT */
/* MAIN */
const invert = (color, weight = 100) => {
    const inverse = index.parse(color);
    inverse.r = 255 - inverse.r;
    inverse.g = 255 - inverse.g;
    inverse.b = 255 - inverse.b;
    return mix(inverse, color, weight);
};

module.exports = invert;
