RSDColorThemeElementObject

public struct RSDColorThemeElementObject : RSDColorThemeElement, RSDDecodableBundleInfo, Codable

RSDColorThemeElementObject tells the UI what the background color and foreground color are for a given view as well as whether or not the foreground elements should use light style.

  • Declaration

    Swift

    public let bundleIdentifier: String?
  • Hint for whether or not the view uses light style for things like the progress bar and navigation buttons.

    Declaration

    Swift

    public var usesLightStyle: Bool
  • Available for watchOS.

    The background color for this step. If undefined then the background color appropriate to the light style will be used.

  • Available for iOS and tvOS.

    The background color for this step. If undefined then the background color appropriate to the light style will be used.

    Declaration

    Swift

    public func backgroundColor(compatibleWith traitCollection: UITraitCollection?) -> UIColor?

    Return Value

    The color or nil if undefined.

  • Available for watchOS.

    The foreground color for this step. If undefined then the foreground color appropriate to the light style will be used.

  • Available for iOS and tvOS.

    The foreground color for this step. If undefined then the foreground color appropriate to the light style will be used.

    Declaration

    Swift

    public func foregroundColor(compatibleWith traitCollection: UITraitCollection?) -> UIColor?

    Return Value

    The color or nil if undefined.

  • Default initializer.

    Note

    The color names used by this Codable object can be defined as either:
  • HEX-code values.
  • Using a Color Asset if targeting devices that support this feature. For example, iOS 11 and above. See https://developer.apple.com/documentation/uikit/uicolor/2877380-init for more information.
  • A mapping file called ColorInfo.plist that includes key/value pairs where the key is the name included here and the value is a HEX-code color.

  • Declaration

    Swift

    public init(usesLightStyle: Bool = false, backgroundColorName: String?, foregroundColorName: String? = nil, bundleIdentifier: String? = nil)

    Parameters

    usesLightStyle

    Hint for whether or not the view uses light style for things like the progress bar. Default = false.

    backgroundColorName

    The name of the background color. Default = nil.

    foregroundColorName

    The name of the foreground color. Default = nil.

    bundleIdentifier

    The bundle identifier for where to find the color asset or plist mapping file. Default = nil.