Gjsify LogoGjsify Logo

Color representation.

record

Hierarchy

  • Color

Index

Constructors

  • new Color(red: number, green: number, blue: number, alpha: number): Clutter.Color
  • Creates a new #ClutterColor with the given values.

    This function is the equivalent of:

    |[ clutter_color_init (clutter_color_alloc (), red, green, blue, alpha);


    @constructor
    @param red red component of the color, between 0 and 255
    @param green green component of the color, between 0 and 255
    @param blue blue component of the color, between 0 and 255
    @param alpha alpha component of the color, between 0 and 255

    Parameters

    • red: number
    • green: number
    • blue: number
    • alpha: number

    Returns Clutter.Color

Properties

alpha: number

alpha component, between 0 and 255

field
blue: number

blue component, between 0 and 255

field
green: number

green component, between 0 and 255

field
red: number

red component, between 0 and 255

field
name: string

Methods

  • Adds a to b and saves the resulting color inside result.

    The alpha channel of result is set as as the maximum value between the alpha channels of a and b.

    Parameters

    Returns Clutter.Color

  • Compares two #ClutterColors 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 #ClutterColors as keys in a #GHashTable.

    Parameters

    Returns boolean

  • free(): void
  • hash(): number
  • Converts a #ClutterColor to a hash value.

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

    Returns number

  • init(red: number, green: number, blue: number, alpha: number): Clutter.Color
  • Initializes color with the given values.

    Parameters

    • red: number

      red component of the color, between 0 and 255

    • green: number

      green component of the color, between 0 and 255

    • blue: number

      blue component of the color, between 0 and 255

    • alpha: number

      alpha component of the color, between 0 and 255

    Returns Clutter.Color

  • Shades color by factor and saves the modified color into result.

    Parameters

    • factor: number

      the shade factor to apply

    Returns Clutter.Color

  • Subtracts b from a and saves the resulting color inside result.

    This function assumes that the components of a are greater than the components of b; the result is, otherwise, undefined.

    The alpha channel of result is set as the minimum value between the alpha channels of a and b.

    Parameters

    Returns Clutter.Color

  • toHls(): [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]

  • toPixel(): number
  • Converts color into a packed 32 bit integer, containing all the four 8 bit channels used by #ClutterColor.

    Returns number

  • toString(): string
  • Returns a textual specification of color in the hexadecimal form #rrggbbaa, where r, g, b and a are hexadecimal digits representing the red, green, blue and alpha components respectively.

    Returns string

  • fromHls(hue: number, luminance: number, saturation: number): Clutter.Color
  • Converts a color expressed in HLS (hue, luminance and saturation) values into a #ClutterColor.

    Parameters

    • hue: number

      hue value, in the 0 .. 360 range

    • luminance: number

      luminance value, in the 0 .. 1 range

    • saturation: number

      saturation value, in the 0 .. 1 range

    Returns Clutter.Color

  • Converts pixel from the packed representation of a four 8 bit channel color to a #ClutterColor.

    Parameters

    • pixel: number

      a 32 bit packed integer containing a color

    Returns Clutter.Color

  • Parses a string definition of a color, filling the #ClutterColor.red, #ClutterColor.green, #ClutterColor.blue and #ClutterColor.alpha fields of color.

    The color is not allocated.

    The format of str can be either one of:

    • a standard name (as taken from the X11 rgb.txt file)
    • an hexadecimal value in the form: #rgb, #rrggbb, #rgba, or #rrggbbaa
    • a RGB color in the form: rgb(r, g, b)
    • a RGB color in the form: rgba(r, g, b, a)
    • a HSL color in the form: hsl(h, s, l) -a HSL color in the form: hsla(h, s, l, a)

    where 'r', 'g', 'b' and 'a' are (respectively) the red, green, blue color intensities and the opacity. The 'h', 's' and 'l' are (respectively) the hue, saturation and luminance values.

    In the rgb() and rgba() formats, the 'r', 'g', and 'b' values are either integers between 0 and 255, or percentage values in the range between 0% and 100%; the percentages require the '%' character. The 'a' value, if specified, can only be a floating point value between 0.0 and 1.0.

    In the hls() and hlsa() formats, the 'h' value (hue) is an angle between 0 and 360.0 degrees; the 'l' and 's' values (luminance and saturation) are percentage values in the range between 0% and 100%. The 'a' value, if specified, can only be a floating point value between 0.0 and 1.0.

    Whitespace inside the definitions is ignored; no leading whitespace is allowed.

    If the alpha component is not specified then it is assumed to be set to be fully opaque.

    Parameters

    • str: string

      a string specifiying a color

    Returns [boolean, Clutter.Color]

  • Retrieves a static color for the given color name

    Static colors are created by Clutter and are guaranteed to always be available and valid

    Parameters

    Returns Clutter.Color

  • new(red: number, green: number, blue: number, alpha: number): Clutter.Color
  • Creates a new #ClutterColor with the given values.

    This function is the equivalent of:

    |[ clutter_color_init (clutter_color_alloc (), red, green, blue, alpha);


    @constructor
    @param red red component of the color, between 0 and 255
    @param green green component of the color, between 0 and 255
    @param blue blue component of the color, between 0 and 255
    @param alpha alpha component of the color, between 0 and 255

    Parameters

    • red: number
    • green: number
    • blue: number
    • alpha: number

    Returns Clutter.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