<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/CustomMaterial/BaseColor-swift.struct/init(tint:texture:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation14CustomMaterialV9BaseColorV0A3KitE4tint7textureAESo7NSColorC_AC0cD7TextureVSgtcfc::OverloadGroup"
  },
  "title" : "init(tint:texture:)"
}
-->

# init(tint:texture:)

Creates a base color object from a color or texture on macOS.

```
init(tint: NSColor = .white, texture: CustomMaterial.Texture? = nil)
```

## Parameters

`tint`

The tint color. Defaults to white.

`texture`

An optional image texture.

## Discussion

This initializer creates a new object from a color or image texture, or
from both. If you don’t provide a `tint` color, `tint` defaults to
white.

Both tint and texture are available to use in your surface shader
function, but RealityKit doesn’t automatically use them to render the
entity. Your surface shader calculates the final base color value for
each pixel and assigns it by calling
`params.surface().set_base_color()`.

For more information on creating custom materials and writing shader
functions, see
[Modifying RealityKit rendering using custom materials](/documentation/RealityKit/modifying-realitykit-rendering-using-custom-materials).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)