GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
AG_COLOR(3) FreeBSD Library Functions Manual AG_COLOR(3)

AG_Color
agar color structure

#include <agar/core.h>
#include <agar/gui.h>

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.

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


AG_Color
AG_ColorFromString(const char *spec, const AG_Color *parentColor);


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_ColorFromString() function converts a text-based color representation to an AG_Color. The following formats are allowed:

	"#RRGGBB"
	"r:g:b[:a]"
	"r,g,b[,a]"
	"rgb(r,g,b[,a])"
	"hsv(h,s,v[,a])"

If components are given with a terminating "%" character, they are interpreted as a percentage of the corresponding component in parentColor (assuming the argument is non-NULL).

The AG_ColorCompare() function returns non-zero if the two given colors differ.

AG_Intro(3), AG_MapColorRGB(3), AG_MapColorRGBA(3), AG_MapPixelRGB(3), AG_MapPixelRGBA(3), AG_Widget(3)

Colors in Agar were originally described as 32-bit packed pixel values. This was replaced by the AG_Color structure in Agar 1.4.
October 14, 2009 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.