Represents 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.
type array_of_Gdk_RGBA is array (Natural range <>) of Gdk_RGBA;
Black_RGBA : constant Gdk_RGBA := (0.0, 0.0, 0.0, 1.0);
function Copy (Self : Gdk_RGBA) return Gdk_RGBA
Makes a copy of a GdkRGBA. The result must be freed through [methodGdk.RGBA.free].
A newly allocated GdkRGBA, with the same contents as Rgba
procedure Free (Self : Gdk_RGBA)
Frees a GdkRGBA.
function From_Object_Free
(B : not null access Gdk_RGBA) return Gdk_RGBA
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
type Gdk_RGBA is record
Red : Interfaces.C.C_float;
Green : Interfaces.C.C_float;
Blue : Interfaces.C.C_float;
Alpha : Interfaces.C.C_float;
end record;
Represents 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.
function Gdk_RGBA_Or_Null (Val : System.Address) return System.Address
Used for the GtkAda binding itself. Return either a Null_Address or a pointer to Val, depending on whether Val is the null value for the type. In all cases, Val is supposed to be an access to the type mentioned in the name of the subprogram. In Ada2012, these could be replaced with expression functions instead.
function Get_Property
(Object : access Glib.Object.GObject_Record'Class;
Name : Property_RGBA) return Gdk_RGBA
function Get_Type return Glib.GType
function Get_Value (Value : Glib.Values.GValue) return Gdk_RGBA
Conversion functions for storing a Gdk_RGBA as a GValue.
function Is_Clear (Self : Gdk_RGBA) return Boolean
Checks if an Rgba value is transparent. That is, drawing with the value would not produce any change.
True if the Rgba is clear
function Is_Opaque (Self : Gdk_RGBA) return Boolean
Checks if an Rgba value is opaque. That is, drawing with the value will not retain any results from previous contents.
True if the Rgba is opaque
Null_RGBA : constant Gdk_RGBA := (0.0, 0.0, 0.0, 0.0);
procedure Parse
(Self : out Gdk_RGBA;
Spec : UTF8_String;
Success : out Boolean)
Parses a textual representation of a color. The string can be either one of:
A standard name (Taken from the CSS specification). - A hexadecimal
value in the form "\rgb", "\rrggbb", "\rrrgggbbb" or "\rrrrggggbbbb" - A hexadecimal value in the form "\rgba", "\rrggbbaa", or "\rrrrggggbbbbaaaa" - A RGB color in the form "rgb(r,g,b)" (In this case the color will have full opacity) - A RGBA color in the form "rgba(r,g,b,a)" - A HSL color in the form "hsl(h,s,l)" - A HSLA color in the form "hsla(h,s,l,a)" Where "r", "g", "b" and "a" are respectively the red, green, blue and alpha color values. In the last two cases, "r", "g", and "b" are either integers in the range 0 to 255 or percentage values in the range 0% to 100%, and a is a floating point value in the range 0 to 1. The range for "h" is 0 to 360, and "s", "l" can be either numbers in the range 0 to 100 or percentages.
the string specifying the color
True if the parsing succeeded
function Print
(Self : Gdk_RGBA;
String : Glib.String.Gstring) return Glib.String.Gstring
type Property_RGBA is new Glib.Property;
procedure Set_Property
(Object : access Glib.Object.GObject_Record'Class;
Name : Property_RGBA;
Value : Gdk_RGBA)
procedure Set_Value (Value : in out Glib.Values.GValue; Val : Gdk_RGBA)
Conversion functions for storing a Gdk_RGBA as a GValue.
function To_String (Self : Gdk_RGBA) return UTF8_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. These string forms are string forms that are supported by the CSS3 colors module, and can be parsed by [methodGdk.RGBA.parse]. Note that this string representation may lose some precision, since "r", "g" and "b" are represented as 8-bit integers. If this is a concern, you should use a different representation.
A newly allocated text string
White_RGBA : constant Gdk_RGBA := (1.0, 1.0, 1.0, 1.0);