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) #

def self.new(data : LibGdk::RGBA, _transfer : GICrystal::Transfer) #

def self.new(red : Float32? = nil, green : Float32? = nil, blue : Float32? = nil, alpha : Float32? = nil) #

Class Method Detail

def self.g_type : UInt64 #

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


Instance Method Detail

def ==(other : self) : Bool #

def alpha(*args, **options) #

def alpha(*args, **options, &) #

def alpha=(arg) #

def blue(*args, **options) #

def blue(*args, **options, &) #

def blue=(arg) #

def copy : Gdk::RGBA #

def equal(p2 : Gdk::RGBA) : Bool #

def free : Nil #

def green(*args, **options) #

def green(*args, **options, &) #

def green=(arg) #

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.


def is_clear : Bool #

def is_opaque : Bool #

def parse(spec : String) : Bool #

def red(*args, **options) #

def red(*args, **options, &) #

def red=(arg) #

def to_string : String #