Color Inverter explainer

Aim of the puzzle: Create a function that returns a color to use in drawBox()
Walk through of solution: In this puzzle, you will write a function that takes a color and returns the inverted version of that color, which can then be used in the drawBox() function.

1st, a quick explanation about color and drawBox:

The drawBox() function takes an object with red, green, and blue properties. Each property is a number between 0 and 255. For example, the color red would be an object with red: 255 and both green and blue set to 0.

The invert() function takes one of these objects, and subtracts each of these values from 255. This will find the inverted (or opposite) color. For example, if we have a green object:

{
    red: 0,
    green: 255,
    blue: 0
}

The invert() function will return:

{
    red: 255,
    green: 0,
    blue: 255
}

This will create a pink/purple color.

To complete the puzzle, finish the invert() function. Set the green property to 255 - object.green and the blue property to 255 - object.blue. The call the function at the bottom of the code.

Sample code solution:

let color = {
    red: 255,
    green: 0,
    blue: 100
};
function invert(object) {
    let newObject = {
        red: 255 - object.red,
        green: 255 - object.green,
        blue: 255 - object.blue
    };
    return newObject;
}
drawBox(color);
drawBox(invert(color));

Javascript Concepts: Objects, Properties, Functions, Return Statements
Grasshopper Concepts: drawBox()