constructor(x, y, scope = globalScope, dir = 'UP', pinLength = 1) {
        super(x, y, scope, dir, 8);
        /* this is done in this.baseSetup() now
        this.scope['SquareRGBLed'].push(this);
        */
        this.rectangleObject = false;
        this.setDimensions(15, 15);
        this.pinLength = pinLength === undefined ? 1 : pinLength;
        const nodeX = -10 - 10 * pinLength;
        this.inp1 = new Node(nodeX, -10, 0, this, 8, 'R');
        this.inp2 = new Node(nodeX, 0, 0, this, 8, 'G');
        this.inp3 = new Node(nodeX, 10, 0, this, 8, 'B');
        this.inp = [this.inp1, this.inp2, this.inp3];
        this.labelDirection = 'UP';
        this.fixedBitWidth = true;

        // eslint-disable-next-line no-shadow
        this.changePinLength = function (pinLength) {
            if (pinLength === undefined) return;
            pinLength = parseInt(pinLength, 10);
            if (pinLength < 0 || pinLength > 1000) return;

            // Calculate the new position of the LED, so the nodes will stay in the same place.
            const diff = 10 * (pinLength - this.pinLength);
            // eslint-disable-next-line no-nested-ternary
            const diffX = this.direction === 'LEFT' ? -diff : this.direction === 'RIGHT' ? diff : 0;
            // eslint-disable-next-line no-nested-ternary
            const diffY = this.direction === 'UP' ? -diff : this.direction === 'DOWN' ? diff : 0;

            // Build a new LED with the new values; preserve label properties too.
            const obj = new SquareRGBLed(this.x + diffX, this.y + diffY, this.scope, this.direction, pinLength);
            obj.label = this.label;
            obj.labelDirection = this.labelDirection;

            this.cleanDelete();
            simulationArea.lastSelected = obj;
            return obj;
        };

        this.mutableProperties = {
            pinLength: {
                name: 'Pin Length',
                type: 'number',
                max: '1000',
                min: '0',
                func: 'changePinLength',
            },
        };
    }
@class
SquareRGBLed
@extends CircuitElement
@param {number} x - x coordinate of element.
@param {number} y - y coordinate of element.
@param {Scope=} scope - Cirucit on which element is drawn
@param {string=} dir - direction of element
@param {number=} pinLength - pins per node.
@category modules