---
title: MDLColorSwatchTexture
framework: modelio
role: symbol
role_heading: Class
path: modelio/mdlcolorswatchtexture
---

# MDLColorSwatchTexture

A generator of texel data that creates a gradient between two specified colors.

## Declaration

```swift
class MDLColorSwatchTexture
```

## Overview

Overview A MDLColorSwatchTexture object procedurally generates texel data by creating a gradient between two colors. Like other procedural MDLTexture subclasses, the MDLColorSwatchTexture class generates texel data only when that data is first referenced, and caches it for future use.

## Topics

### Creating a Color Swatch Texture

- [init(colorGradientFrom:to:name:textureDimensions:)](modelio/mdlcolorswatchtexture/init(colorgradientfrom:to:name:texturedimensions:).md)
- [init(colorTemperatureGradientFrom:toColorTemperature:name:textureDimensions:)](modelio/mdlcolorswatchtexture/init(colortemperaturegradientfrom:tocolortemperature:name:texturedimensions:).md)

### Initializers

- [init(colorGradientFrom:toColor:name:textureDimensions:)](modelio/mdlcolorswatchtexture/init(colorgradientfrom:tocolor:name:texturedimensions:).md)

## Relationships

### Inherits From

- [MDLTexture](modelio/mdltexture.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [MDLNamed](modelio/mdlnamed.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Textures

- [MDLTexture](modelio/mdltexture.md)
- [MDLCheckerboardTexture](modelio/mdlcheckerboardtexture.md)
- [MDLNoiseTexture](modelio/mdlnoisetexture.md)
- [MDLNormalMapTexture](modelio/mdlnormalmaptexture.md)
- [MDLSkyCubeTexture](modelio/mdlskycubetexture.md)
- [MDLURLTexture](modelio/mdlurltexture.md)
- [MDLTextureFilter](modelio/mdltexturefilter.md)
- [MDLTextureSampler](modelio/mdltexturesampler.md)
