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


Manual Reference Pages  -  CURSES::UI::COLOR (3)

.ds Aq ’

NAME

Curses::UI::Color - Color support module

CONTENTS

WARNING

This is a development version. As I do not expect to change the interface during this time it may happen that the color behaviour (e.g. to what extend color is drawn in a window) may change or even the colors themselves. If you want something stable, use -color_support => 0 , but you won’t get those fency colors then :-)

DESCRIPTION

This module provides all functions related to color support in Curses::UI. The color support was implemented without disturbing old applications, they will look as they used to do. Only if you enable color support explicitly and it is available on your terminal the color functions will have an effect.

SYNOPSIS

my $cui = new Curses::UI(-color_support => 1,
-clear_on_exit => 0);

my $mainw = $cui->add(’screen’, ’Window’);

$mainw->add(’l’,’Label’, -bg => white,
-fg => blue,
-text => Colored Label);

METHODS

o <B>newB> (-default-colors => BOOLEAN)

Creates a new Curses::UI::Color object, the option default colors define if the use_default_colors function of Curses is used. See Curses for that.

o <B>get_colorsB> ( )

Returns all in this object defined colors as an array

o <B>colorsB> ( )

Is true if color support is enabled.

o <B>define_colorB> ( NAME, R, G, B )

This function defines a new color in the Color object. The RGB values can be between 0 and 1000. Existing colors can be redefined.

USAGE

Curses::UI has 7 predefined colors:
black
red
green
yellow
blue
magenta
cyan
white

Curses::UI with color support also defines some new options:



     -fg  -bg for general foreground and background color.
    -tfg -tbg for widget title fg and bg color
    -bfg -bbg for widget border fg and bg color
    -sfg -sbg for scrollbar fg and bg color



Every widget has has a runtime setter:
set_color_fg ( COLOR )
set_colof_bg ( COLOR )
set_color_tfg ( COLOR )
set_colof_tbg ( COLOR )
set_color_bfg ( COLOR )
set_colof_bbg ( COLOR )
set_color_sfg ( COLOR )
set_colof_sbg ( COLOR )

Mostly every widget has a -fg and -bg option to set the foreground and background color using the above color names. Own colors can be defined using the <B>define_colorB> method. Every widget that supports color by now has also two functions <B>set_color_fgB> and <B>set_color_bgB> to set or change the color at runtime. Widgets with borders and scrollbars can use -bfg and -bbg to set the foreground and background color of the border or the -sfg and -sbg option to set the colors of the scrollbar. Widgets with titles can set the -tfg and -tbg option to define the title foreground and background color.

Check also the examples/color_editor for seeing what is possible at the moment.

SEE ALSO

Curses::UI

AUTHOR

Copyright (c) 2003 Marcus Thiesen. All rights reserved.

Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de)

This package is free software and is provided as is without express or implied warranty. It may be used, redistributed and/or modified under the same terms as perl itself.

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


perl v5.20.3 CURSES::UI::COLOR (3) 2011-09-01

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