MaterialSwatch

Abstract Class
Base type for color swatches. Supports a primary value, indexed shades, and conversion to Unity colors.

Fields

name: string

Properties

PrimaryArgb: int
Primary ARGB value of the swatch. For normal swatches this is typically shade 500. For accent swatches this is typically shade 200.
StyleValue: StyleColor
this[int]: Color
Resolves a shade by weight.
Value: Color
Weights: ReadOnlySpan<int>
Ordered list of valid shade weights for this swatch.

Constructors

MaterialSwatch(primaryArgb: int, name: string)
MaterialSwatch(primaryArgb: uint, name: string)

Methods

ToSwatch(): Color[]
Returns all shades in the natural order of this swatch type.
ToSwatch(weights: int[]): Color[]
Returns shades for arbitrary weights.
ToString(): string
GetArgb(weight: int): int
Resolves a shade ARGB by weight.

Operators

Color(swatch: MaterialSwatch): Color
StyleColor(swatch: MaterialSwatch): StyleColor

Inherited Members

Extension Methods

DescribeIdentityShortHashToStringNullable

On this page