function set( opacity ) {
	/* eslint-disable no-invalid-this */
	if ( !isNumber( opacity ) ) {
		throw new TypeError( format( 'invalid assignment. `%s` must be a number. Value: `%s`.', 'opacity', opacity ) );
	}
	if (
		opacity < 0.0 ||
		opacity > 1.0
	) {
		throw new RangeError( format( 'invalid assignment. `%s` must be a number on the interval: [0, 1]. Value: `%f`.', 'opacity', opacity ) );
	}
	debug( 'Current value: %d.', this._opacity );

	this._opacity = opacity;
	debug( 'New Value: %d.', this._opacity );

	this.emit( 'change' );
}
Sets the opacity.

@private
@param {number} opacity - opacity
@throws {TypeError} must be a number
@throws {RangeError} must be a number on the interval `[0,1]`