struct Gdk::RGBA
- Gdk::RGBA
- Struct
- Value
- Object
Overview
Represents 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.crConstructors
- .new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
- .new(data : LibGdk::RGBA, _transfer : GICrystal::Transfer)
- .new(red : Float32 | Nil = nil, green : Float32 | Nil = nil, blue : Float32 | Nil = nil, alpha : Float32 | Nil = nil)
Class Method Summary
-
.g_type : UInt64
Returns the type id (GType) registered in GLib type system.
Instance Method Summary
- #==(other : self) : Bool
- #alpha(*args, **options)
- #alpha(*args, **options, &)
- #alpha=(arg)
- #blue(*args, **options)
- #blue(*args, **options, &)
- #blue=(arg)
- #copy : Gdk::RGBA
- #equal(p2 : Gdk::RGBA) : Bool
- #free : Nil
- #green(*args, **options)
- #green(*args, **options, &)
- #green=(arg)
-
#hash : UInt32
Generates an
UInt64hash value for this object. - #is_clear : Bool
- #is_opaque : Bool
- #parse(spec : String) : Bool
- #red(*args, **options)
- #red(*args, **options, &)
- #red=(arg)
- #to_string : String
Constructor Detail
Class Method Detail
Instance Method Detail
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.