Contents

What is fGUI ?

fGUI basics
The factory
Event model
Legal Issues
Things to do
History

Tree of classes
About

The classes

fApplication
fClassInfo
fColor
fGroup
fObject
fPoint

The flexible GUI: fColor

Declared in: fGUI/fColor.h

Library: fGUI.so


Overview

fColor is the fGUI version of Be's rgb_color structure.It has the same layout in terms of variables but has some benefits because of being a full featured class. Amongst the new features are the assignment operator and the possibility to create them on the fly in function calls.


Data Members

uint8 fRed
The red component.

uint8 fGreen
The green component.

uint8 fBlue
The blue component.

uint8 fAlpha
The alpha component.

Note: The color components are currently public but this will change in later releases ! So don't access them or your code will break.


Constructor


fColor()

	fColor( uint8 Red = 255, uint8 Green = 255, uint8 Blue = 255, uint8 Alpha = 255)
	fColor( const fColor &Color)
	fColor( const rgb_color &Color)
There are three possibilities for a fColor to be created. First of all you can specify all color values and the alpha component directly in the call to the constructor. For example:
	fColor White();
	fColor SomeColor( 255, 128,0);
initializes White to white and SomeColor to Orange.

Then there are two copy constructors that allow constructing a fColor object from both another fColor object and a rgb_color structure. For example:

	fColor Green( 0, 255, 0);
	fColor GreenAgain( Green);

	rgb_color black = { 0, 0, 0, 255};
	fColor Black( black);
Here GreenAgain gets the same values as Green and Black is as black as black.


Member Functions


printToStream()

	void printToStream( const char *Text = NULL) const
This method is prints the fColor's values in the form "fColor( Red, Green, Blue, Alpha)" preceeded by Text if it is not NULL. printToStream() prints to stderr, not stdout.


Operators


= (assignment)

	fColor &operator =( const fColor &Color)
	fColor &operator =( const rgb_color &Color)
Assigns the values from Color which can either be a fColor object or a rgb_color structure. After the call both objects represent the same color.


== (equality)

	bool operator ==( const fColor &Color) const
	bool operator ==( const rgb_color &Color) const
Compares the values in the fColor object with the values from Color. Returns true if all values are identical, false in all other cases.


!= (inequality)

	bool operator !=( const fColor &Color) const
	bool operator !=( const rgb_color &Color) const
Compares the values in the fColor object with the values from Color. Returns true if they differ in at least one component and false if they are identical.


rgb_color (cast)

	operator rgb_color( void) const
Returns a rgb_color structure with the same values as the fColor object. Used often when passing a fColor object to the BView, e.g. in SetHighColor().


The flexible GUI, in HTML for the BeOS Release 3.

Copyright © 1997-1998 Stegemann & Co. All rights reserved.

Last modified May 19, 1998.