Rgba

class Rgba(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

A GdkRGBA is used to represent a color, in a way that is compatible with cairo’s notion of color.

GdkRGBA is a convenient way to pass colors around. It’s based on cairo’s way to deal with colors and mirrors its behavior. All values are in the range from 0.0 to 1.0 inclusive. So the color (0.0, 0.0, 0.0, 0.0) represents transparent black and (1.0, 1.0, 1.0, 1.0) is opaque white. Other values will be clamped to this range when drawing.

Skipped during bindings generation

  • parameter p2: RGBA

Constructors

Link copied to clipboard
constructor()

Allocate a new Rgba.

constructor(scope: <Error class: unknown class>)

Allocate a new Rgba using the provided AutofreeScope.

constructor(red: <Error class: unknown class>, green: <Error class: unknown class>, blue: <Error class: unknown class>, alpha: <Error class: unknown class>)

Allocate a new Rgba.

constructor(red: <Error class: unknown class>, green: <Error class: unknown class>, blue: <Error class: unknown class>, alpha: <Error class: unknown class>, scope: <Error class: unknown class>)

Allocate a new Rgba using the provided AutofreeScope.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>, cleaner: <Error class: unknown class>? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var alpha: <Error class: unknown class>

The opacity of the color from 0.0 for completely translucent to 1.0 for opaque

Link copied to clipboard
var blue: <Error class: unknown class>

The intensity of the blue channel from 0.0 to 1.0 inclusive

Link copied to clipboard
val gdkRGBAPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
var green: <Error class: unknown class>

The intensity of the green channel from 0.0 to 1.0 inclusive

Link copied to clipboard
var red: <Error class: unknown class>

The intensity of the red channel from 0.0 to 1.0 inclusive

Functions

Link copied to clipboard
fun copy(): Rgba

Makes a copy of a GdkRGBA.

Link copied to clipboard
fun free()

Frees a GdkRGBA.

Link copied to clipboard
fun hash(): <Error class: unknown class>

A hash function suitable for using for a hash table that stores GdkRGBAs.

Link copied to clipboard

Checks if an @rgba value is transparent.

Link copied to clipboard

Checks if an @rgba value is opaque.

Link copied to clipboard
fun parse(spec: String): Boolean

Parses a textual representation of a color.

Link copied to clipboard
open override fun toString(): String

Returns a textual specification of @rgba in the form rgb(r,g,b) or rgba(r,g,b,a), where “r”, “g”, “b” and “a” represent the red, green, blue and alpha values respectively. “r”, “g”, and “b” are represented as integers in the range 0 to 255, and “a” is represented as a floating point value in the range 0 to 1.