struct Gdk::RGBA

Overview

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

Gdk::RGBA 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.

Defined in:

lib/gi-crystal/src/auto/gdk-4.0/rgba.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(pointer : Pointer(Void), transfer : GICrystal::Transfer) #

[View source]
def self.new(data : LibGdk::RGBA, _transfer : GICrystal::Transfer) #

[View source]
def self.new(red : Float32 | Nil = nil, green : Float32 | Nil = nil, blue : Float32 | Nil = nil, alpha : Float32 | Nil = nil) #

[View source]

Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


[View source]

Instance Method Detail

def ==(other : self) : Bool #

[View source]
def alpha(*args, **options) #

[View source]
def alpha(*args, **options, &) #

[View source]
def alpha=(arg) #

[View source]
def blue(*args, **options) #

[View source]
def blue(*args, **options, &) #

[View source]
def blue=(arg) #

[View source]
def copy : Gdk::RGBA #

[View source]
def equal(p2 : Gdk::RGBA) : Bool #

[View source]
def free : Nil #

[View source]
def green(*args, **options) #

[View source]
def green(*args, **options, &) #

[View source]
def green=(arg) #

[View source]
def hash : UInt32 #
Description copied from class Object

Generates an UInt64 hash value for this object.

This method must have the property that a == b implies a.hash == b.hash.

The hash value is used along with #== by the Hash class to determine if two objects reference the same hash key.

Subclasses must not override this method. Instead, they must define hash(hasher), though usually the macro def_hash can be used to generate this method.


[View source]
def is_clear : Bool #

[View source]
def is_opaque : Bool #

[View source]
def parse(spec : String) : Bool #

[View source]
def red(*args, **options) #

[View source]
def red(*args, **options, &) #

[View source]
def red=(arg) #

[View source]
def to_string : String #

[View source]