RSDColorMatrix
public final class RSDColorMatrix
The color matrix is a shared singleton that allows for accessing the color palettes using registered libraries that are included within the Research framework.
-
The color libraries that are registered with the Research framework. The libraries are loaded using a lazy loading. If the application receives a low memory warning, then the libraries are released from memory.
Declaration
Swift
public var registeredLibraries: [RSDColorLibrary] { get } -
The current version of the default color library.
Declaration
Swift
public var currentVersion: Int { get } -
The library for a given version.
Declaration
Swift
public func library(for version: Int?) -> RSDColorLibraryParameters
versionThe version to return or
nilto return the most recent.Return Value
The color library for this version.
-
Get the gray scale to use for a given version of the color library.
Declaration
Swift
public func grayScale(for version: Int?) -> RSDGrayScaleParameters
versionThe version to return or
nilto return the most recent.Return Value
The gray scale for this version.
-
Get the color swatch associated with the given name.
Declaration
Swift
public func colorSwatch(for name: RSDReservedColorName, version: Int?) -> RSDColorSwatch?Parameters
nameThe name of the color swatch.
versionThe version to return or
nilto return the most recent.Return Value
The color swatch for the given name and version.
-
Get the color swatch associated with the given name.
Declaration
Swift
public func colorKey(for name: RSDReservedColorName, shade: RSDColorSwatch.Shade) -> RSDColorKeyParameters
nameThe name of the color swatch.
shadeThe shade of the color.
Return Value
The color key for the given name and shade.
-
Get the most appropriate color key for a given reserved color name.
Declaration
Swift
public func colorKey(for name: RSDReservedColorName, version: Int? = nil, index: Int? = nil) -> RSDColorKeyParameters
nameThe name of the color swatch.
versionThe version to return or
nilto return the most recent.indexThe index into the color swatch or
nilto return thedarkshade.Return Value
The color key.
-
Get the most appropriate color mappinng for a gray scale color.
Declaration
Swift
public func colorMapping(for gray: RSDGrayScale.Shade, version: Int? = nil) -> RSDColorMappingParameters
shadeThe shade of the color.
versionThe version to return or
nilto return the most recent.Return Value
The color mapping.
-
Find a color mapping from the color. This will look through the libraries and swatches for a matching color.
Declaration
Swift
public func findColorKey(for colorName: String) -> RSDColorKey?Parameters
colorThe color to find.
Return Value
The color tile for this color, if found.
-
Find a color tile from the color. This will look through the libraries and swatches for a matching color.
Declaration
Swift
public func findColorTile(for color: RSDColor) -> RSDColorTile?Parameters
colorThe color to find.
Return Value
The color tile for this color, if found.
View on GitHub
RSDColorMatrix Class Reference