Color

public struct Color : CustomStringConvertible, Codable, Equatable

Represents background color

  • The red value of the color object. Values between [0, 255]

    Declaration

    Swift

    public let r: UInt8
  • The green value of the color object. Values between [0, 255]

    Declaration

    Swift

    public let g: UInt8
  • The blue value of the color object. Values between [0, 255]

    Declaration

    Swift

    public let b: UInt8
  • The alpha value of the color object. Values between [0.0, 1.0]

    Declaration

    Swift

    public let a: Double
  • Initializes a CarbonStyle.Color

    Declaration

    Swift

    public init(r: UInt8, g: UInt8, b: UInt8, a: Double)

    Parameters

    r

    The red value of the color object.

    g

    The green value of the color object.

    b

    The blue value of the color object.

    a

    The alpha value of the color object.

  • A query string representation of Color.

    Declaration

    Swift

    public var description: String { get }
  • A group of predefined Carbon colors.

    Declaration

    Swift

    public static let all: [String : CarbonStyle.Color]
  • Predefined nef Color.

    Declaration

    Swift

    public static let nef: CarbonStyle.Color
  • Predefined bow Color.

    Declaration

    Swift

    public static let bow: CarbonStyle.Color
  • Predefined white Color.

    Declaration

    Swift

    public static let white: CarbonStyle.Color
  • Predefined yellow Color.

    Declaration

    Swift

    public static let yellow: CarbonStyle.Color
  • Predefined green Color.

    Declaration

    Swift

    public static let green: CarbonStyle.Color
  • Predefined blue Color.

    Declaration

    Swift

    public static let blue: CarbonStyle.Color
  • Predefined orange Color.

    Declaration

    Swift

    public static let orange: CarbonStyle.Color
  • Initializes a CarbonStyle.Color

    Declaration

    Swift

    public init?(hex: String)

    Parameters

    hex

    Creates a Color from a hexadecimal String.

  • Initializes a CarbonStyle.Color.

    Declaration

    Swift

    public init?(default string: String)

    Parameters

    default

    Creates a Color from a predefined value.

  • Converts Color into its hexadecimal representation.

    Declaration

    Swift

    public var hex: String { get }