Gjsify LogoGjsify Logo

A structure for holding a color definition. The contents of the CoglColor structure are private and should never by accessed directly.

record

Hierarchy

  • Color

Index

Constructors

Properties

name: string

Methods

  • free(): void
  • Frees the resources allocated by cogl_color_new() and cogl_color_copy()

    Returns void

  • getAlpha(): number
  • Retrieves the alpha channel of color as a fixed point value between 0 and 1.0.

    Returns number

  • getAlphaByte(): number
  • Retrieves the alpha channel of color as a byte value between 0 and 255

    Returns number

  • getAlphaFloat(): number
  • Retrieves the alpha channel of color as a floating point value between 0.0 and 1.0

    Returns number

  • getBlue(): number
  • Retrieves the blue channel of color as a fixed point value between 0 and 1.0.

    Returns number

  • getBlueByte(): number
  • Retrieves the blue channel of color as a byte value between 0 and 255

    Returns number

  • getBlueFloat(): number
  • Retrieves the blue channel of color as a floating point value between 0.0 and 1.0

    Returns number

  • getGreen(): number
  • Retrieves the green channel of color as a fixed point value between 0 and 1.0.

    Returns number

  • getGreenByte(): number
  • Retrieves the green channel of color as a byte value between 0 and 255

    Returns number

  • getGreenFloat(): number
  • Retrieves the green channel of color as a floating point value between 0.0 and 1.0

    Returns number

  • getRed(): number
  • Retrieves the red channel of color as a fixed point value between 0 and 1.0.

    Returns number

  • getRedByte(): number
  • Retrieves the red channel of color as a byte value between 0 and 255

    Returns number

  • getRedFloat(): number
  • Retrieves the red channel of color as a floating point value between 0.0 and 1.0

    Returns number

  • initFrom4f(red: number, green: number, blue: number, alpha: number): void
  • Sets the values of the passed channels into a #CoglColor

    Parameters

    • red: number

      value of the red channel, between 0 and 1.0

    • green: number

      value of the green channel, between 0 and 1.0

    • blue: number

      value of the blue channel, between 0 and 1.0

    • alpha: number

      value of the alpha channel, between 0 and 1.0

    Returns void

  • initFrom4fv(colorArray: number): void
  • Sets the values of the passed channels into a #CoglColor

    Parameters

    • colorArray: number

      a pointer to an array of 4 float color components

    Returns void

  • initFrom4ub(red: number, green: number, blue: number, alpha: number): void
  • Sets the values of the passed channels into a #CoglColor.

    Parameters

    • red: number

      value of the red channel, between 0 and 255

    • green: number

      value of the green channel, between 0 and 255

    • blue: number

      value of the blue channel, between 0 and 255

    • alpha: number

      value of the alpha channel, between 0 and 255

    Returns void

  • premultiply(): void
  • Converts a non-premultiplied color to a pre-multiplied color. For example, semi-transparent red is (1.0, 0, 0, 0.5) when non-premultiplied and (0.5, 0, 0, 0.5) when premultiplied.

    Returns void

  • setAlpha(alpha: number): void
  • Sets the alpha channel of color to alpha.

    Parameters

    • alpha: number

      a float value between 0.0f and 1.0f

    Returns void

  • setAlphaByte(alpha: number): void
  • Sets the alpha channel of color to alpha.

    Parameters

    • alpha: number

      a byte value between 0 and 255

    Returns void

  • setAlphaFloat(alpha: number): void
  • Sets the alpha channel of color to alpha.

    Parameters

    • alpha: number

      a float value between 0.0f and 1.0f

    Returns void

  • setBlue(blue: number): void
  • Sets the blue channel of color to blue.

    Parameters

    • blue: number

      a float value between 0.0f and 1.0f

    Returns void

  • setBlueByte(blue: number): void
  • Sets the blue channel of color to blue.

    Parameters

    • blue: number

      a byte value between 0 and 255

    Returns void

  • setBlueFloat(blue: number): void
  • Sets the blue channel of color to blue.

    Parameters

    • blue: number

      a float value between 0.0f and 1.0f

    Returns void

  • setFrom4f(red: number, green: number, blue: number, alpha: number): void
  • Sets the values of the passed channels into a #CoglColor

    Parameters

    • red: number

      value of the red channel, between 0 and %1.0

    • green: number

      value of the green channel, between 0 and %1.0

    • blue: number

      value of the blue channel, between 0 and %1.0

    • alpha: number

      value of the alpha channel, between 0 and %1.0

    Returns void

  • setFrom4ub(red: number, green: number, blue: number, alpha: number): void
  • Sets the values of the passed channels into a #CoglColor.

    Parameters

    • red: number

      value of the red channel, between 0 and 255

    • green: number

      value of the green channel, between 0 and 255

    • blue: number

      value of the blue channel, between 0 and 255

    • alpha: number

      value of the alpha channel, between 0 and 255

    Returns void

  • setGreen(green: number): void
  • Sets the green channel of color to green.

    Parameters

    • green: number

      a float value between 0.0f and 1.0f

    Returns void

  • setGreenByte(green: number): void
  • Sets the green channel of color to green.

    Parameters

    • green: number

      a byte value between 0 and 255

    Returns void

  • setGreenFloat(green: number): void
  • Sets the green channel of color to green.

    Parameters

    • green: number

      a float value between 0.0f and 1.0f

    Returns void

  • setRed(red: number): void
  • Sets the red channel of color to red.

    Parameters

    • red: number

      a float value between 0.0f and 1.0f

    Returns void

  • setRedByte(red: number): void
  • Sets the red channel of color to red.

    Parameters

    • red: number

      a byte value between 0 and 255

    Returns void

  • setRedFloat(red: number): void
  • Sets the red channel of color to red.

    Parameters

    • red: number

      a float value between 0.0f and 1.0f

    Returns void

  • toHsl(): [number, number, number]
  • Converts color to the HLS format.

    The hue value is in the 0 .. 360 range. The luminance and saturation values are in the 0 .. 1 range.

    Returns [number, number, number]

  • unpremultiply(): void
  • Converts a pre-multiplied color to a non-premultiplied color. For example, semi-transparent red is (0.5, 0, 0, 0.5) when premultiplied and (1.0, 0, 0, 0.5) when non-premultiplied.

    Returns void

  • equal(v1: object, v2: object): number
  • Compares two #CoglColors and checks if they are the same.

    This function can be passed to g_hash_table_new() as the key_equal_func parameter, when using #CoglColors as keys in a #GHashTable.

    Parameters

    • v1: object

      a #CoglColor

    • v2: object

      a #CoglColor

    Returns number

  • initFromHsl(hue: number, saturation: number, luminance: number): Cogl.Color
  • Converts a color expressed in HLS (hue, luminance and saturation) values into a #CoglColor.

    Parameters

    • hue: number

      hue value, in the 0 .. 360 range

    • saturation: number

      saturation value, in the 0 .. 1 range

    • luminance: number

      luminance value, in the 0 .. 1 range

    Returns Cogl.Color

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • 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