Instance Property

clearColor

The color to use when the color render target is cleared.

Declaration

var clearColor: MTLClearColor { get set }

Discussion

If the loadAction property of the render target is set to MTLLoadAction.clear, then at the start of a render pass, the contents of the texture are filled with the value stored in the clearColor property. Otherwise, clearColor is ignored.

The clearColor property represents a set of RGBA components. The default value is (0.0, 0.0, 0.0, 1.0) (black). Use the MTLClearColorMake(_:_:_:_:) function to construct a MTLClearColor value.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software