Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Color

Represents a color object. Stores all color components (alpha (opacity), red, green, blue) in a [0..255] range.

Hierarchy

  • Color

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Color(knownColor: string): Color
  • new Color(hex: string): Color
  • new Color(argb: number): Color
  • new Color(alpha: number, red: number, green: number, blue: number): Color

Properties

a

a: number

Gets the Alpha component (in the [0, 255] range) of this color. This is a read-only property.

android

android: number

Gets the android-specific integer value representation. Same as the Argb one. This is a read-only property.

argb

argb: number

Gets the Argb Number representation of this color where each 8 bits represent a single color component. This is a read-only property.

b

b: number

Gets the Blue component (in the [0, 255] range) of this color. This is a read-only property.

g

g: number

Gets the Green component (in the [0, 255] range) of this color. This is a read-only property.

hex

hex: string

Gets the Hexadecimal string representation of this color. This is a read-only property.

ios

ios: any

Gets the iOS-specific UIColor value representation. This is a read-only property.

name

name: string

Gets the known name of this instance. Defined only if it has been constructed from a known color name - e.g. "red". This is a read-only property.

r

r: number

Gets the Red component (in the [0, 255] range) of this color. This is a read-only property.

Methods

equals

  • equals(value: Color): boolean
  • Specifies whether this Color is equal to the Color parameter.

    Parameters

    • value: Color

      The Color to test.

    Returns boolean

Static equals

  • Compares two Color instances.

    Parameters

    • value1: Color

      A Color to compare.

    • value2: Color

      A Color to compare.

    Returns boolean

Static fromIosColor

  • fromIosColor(value: any): Color
  • Creates color from iOS-specific UIColor value representation.

    Parameters

    • value: any

    Returns Color

Static isValid

  • isValid(value: any): boolean
  • Validates if a value can be converted to color.

    Parameters

    • value: any

      Input string.

    Returns boolean

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method