Repository: pixijs/pixijs
File: src/rendering/renderers/shared/background/BackgroundSystem.ts (TypeScript)

Code before:
    /**
     * initiates the background system
     * @param options - the options for the background colors
     */
    public init(options: BackgroundSystemOptions): void
    {
        options = { ...BackgroundSystem.defaultOptions, ...options };

        this.clearBeforeRender = options.clearBeforeRender;
        this.color = options.background || options.backgroundColor || this._backgroundColor; // run bg color setter
        this.alpha = options.backgroundAlpha;

        this._backgroundColor.setAlpha(options.backgroundAlpha);
    }

    /** The background color to fill if not transparent */
    get color(): Color
    {
        return this._backgroundColor;
    }

    set color(value: ColorSource)
    {
        // #if _DEBUG

        const incoming = new Color(value);

        if (incoming.alpha < 1 && this._backgroundColor.alpha === 1)
        {
            warn(
                'Cannot set a transparent background on an opaque canvas. '
                + 'To enable transparency, set backgroundAlpha < 1 when initializing your Application.'
            );
        }
        // #endif
        this._backgroundColor.setValue(value);
    }

    /** The background color alpha. Setting this to 0 will make the canvas transparent. */
    get alpha(): number
    {
        return this._backgroundColor.alpha;
    }

    set alpha(value: number)
    {
        this._backgroundColor.setAlpha(value);
    }

    /** The background color as an [R, G, B, A] array. */
    get colorRgba(): RgbaArray

Review comment (suggestion):
```suggestion
        const incoming = Color.shared.setValue(value);
```

Code after:
    /**
     * initiates the background system
     * @param options - the options for the background colors
     */
    public init(options: BackgroundSystemOptions): void
    {
        options = { ...BackgroundSystem.defaultOptions, ...options };

        this.clearBeforeRender = options.clearBeforeRender;
        this.color = options.background || options.backgroundColor || this._backgroundColor; // run bg color setter
        this.alpha = options.backgroundAlpha;

        this._backgroundColor.setAlpha(options.backgroundAlpha);
    }

    /** The background color to fill if not transparent */
    get color(): Color
    {
        return this._backgroundColor;
    }

    set color(value: ColorSource)
    {
        // #if _DEBUG

        const incoming = Color.shared.setValue(value);

        if (incoming.alpha < 1 && this._backgroundColor.alpha === 1)
        {
            warn(
                'Cannot set a transparent background on an opaque canvas. '
                + 'To enable transparency, set backgroundAlpha < 1 when initializing your Application.'
            );
        }
        // #endif
        this._backgroundColor.setValue(value);
    }

    /** The background color alpha. Setting this to 0 will make the canvas transparent. */
    get alpha(): number
    {
        return this._backgroundColor.alpha;
    }

    set alpha(value: number)
    {
        this._backgroundColor.setAlpha(value);
    }

    /** The background color as an [R, G, B, A] array. */
    get colorRgba(): RgbaArray