Note: The Agar manual pages follow certain conventions, notably
concerning function return values. Please read
AG_Intro(3)
first.
SYNOPSIS
#include <agar/core.h>
#include <agar/gui.h>
|
DESCRIPTION
Many functions in Agar accept
AG_Color parameters.
This structure describes a color in terms of its red, green and blue and
alpha components:
typedef struct ag_color {
Uint8 r, g, b, a;
} AG_Color;
The alpha component may or may not be used in a particular context; a value
of 0 is fully transparent and 255 is fully opaque.
|
INTERFACE
AG_Color AG_ColorRGB (Uint8 r, Uint8 g, Uint8 b)
AG_Color AG_ColorRGBA (Uint8 r, Uint8 g, Uint8 b, Uint8 a)
AG_Color AG_ColorHex (Uint32 hex)
int AG_ColorCompare (AG_Color a, AG_Color b)
|
The
AG_ColorRGB() routine returns an
AG_Color from the given red, green and blue components.
The alpha component is initialized to 255 (opaque).
AG_ColorRGBA() accepts an explicit alpha component.
AG_ColorHex() returns an
AG_Color structure from an argument of the form 0xRRGGBBAA.
The
AG_ColorCompare() function returns non-zero if the two given colors differ.
|
SEE ALSO
HISTORY
|
Colors in Agar were originally described as 32-bit packed pixel values.
This was replaced by the
AG_Color structure in
Agar 1.4.
|