Kathryn Andersen > Graphics-Colourset-0.01 > colourset

Download:
Graphics-Colourset-0.01.tar.gz

Annotate this POD

View/Report Bugs
Source  

NAME ^

colourset - substitute certain tags with generated colour names.

VERSION ^

This describes version 0.01 of colourset.

SYNOPSIS ^

colourset --help | --manpage | --version

colourset --hue number --numsets number [ --huetype hue-type ] [ --shade number ] [ --traditional ] file ...

DESCRIPTION ^

This uses Graphics::Colourset to generate sets of colours based on an input hue. The input file is processed, substituting certain tags for the generated colours.

If the input file has a .col extension, the output file will be the filename without the .col extension. Otherwise all output is printed to standard output.

OPTIONS ^

--help

Print help message and exit.

--hue n

The hue of the first colourset; the remaining coloursets will be generated to be harmonious with this (by a rule-of-thumb process).

The hue is the hue in a 360 degree colour wheel, from 0 to 360. As a special tweak, if the hue equals 360, it is taken to be no hue at all (grey). This doesn't actually lose any hues, since 360 is normally exactly the same as zero (red).

--huetype hue-type

This determines how to interpret the 'hue' option.

normal

Take the hue as given, and use that value.

random

Ignore the hue value and generate a random hue.

date

Ignore the hue value and generate a hue value depending on today's date. This requires the use of the unix 'date' command, and thus will not work on MS-Windows systems.

--manpage

Print the full help documentation (manual page) and exit.

--numsets n

The number of coloursets to generate.

--shade

Set the shade of a colourset; the first --shade sets the shade of the first colourset, and so on for the later coloursets. Giving a shade of 0 gives a random shade.

The "shade" is the darkness or lightness of the colourset; 1 is the darkest, and 4 is the lightest.

--traditional

Make the colours be output in traditional #nnnnnn notation rather than the more modern rgb:nn/nn/nn notation.

--version

Print version information and exit.

FILE FORMAT ^

When the input file(s) are processed, this looks for "Colour Tag" strings in the file. This is very simple, it does a direct substitution; this is not some sophisticated macro language.

Colour tags are in the form

    COLSETI<colsetnumber>_I<colourname>

The colsetnumber is the number of the colour-set, starting from zero.

The colourname is one of the following colour names:

BACKGROUND

The background colour is the main colour of the colourset, to be used for the background of the "component" (whatever that may be).

TOPSHADOW

The topshadow colour is a colour slightly lighter than the background colour, suitable for using to define a "top shadow" colour.

BOTTOMSHADOW

The bottomshadow colour is a colour slightly darker than the background colour, suitable for using to define a "bottom shadow" colour.

FOREGROUND

The foreground colour is the colour designated to be used for the foreground, for text and the like. It is either much lighter or much darker than the background colour, in order to contrast suitably.

FOREGROUND_INACTIVE

The "inactive" foreground colour is a colour which is intended to be used for things which are "greyed out", or not active. It is a colour which contrasts with the background, but not as much as the "foreground" colour.

EXAMPLES ^

This creates a 'decorations' file from the 'decorations.col' file.

    colourset --hue 0 --shade 0 --shade 1 --numsets 4 decorations.col

In the above, the first colourset is of red hue (hue 0 is red), the first colourset has a random shade, but the second colourset has the darkest shade, and four coloursets are generated.

    colourset --huetype date --shade 0 --shade 1 --numsets 4 decorations.col

The above does the same as the first example, except that the hue is determined by today's date. This can be useful in making your window manager gradually change its colours through the days, but still look nice.

The following is an extract from a configuration file for the Fvwm window manager, with colour-tags placed where the colours would go:

    AddTitleStyle ActiveUp   (VGradient 64 2 COLSET1_TOPSHADOW 40 COLSET1_BACKGROUND 60 COLSET1_BOTTOMSHADOW)
    AddTitleStyle ActiveDown   (VGradient 64 2 COLSET1_BOTTOMSHADOW 60 COLSET1_BACKGROUND 40 COLSET1_TOPSHADOW)
    AddTitleStyle Inactive   (VGradient 64 2 COLSET0_TOPSHADOW 40 COLSET0_BACKGROUND 60 COLSET0_BOTTOMSHADOW)

Note that this uses colourset 0 for the "inactive" colours and colourset 1 for the "active" colours. You can choose whatever you like when you create your files; it probably helps to be consistent, however.

The following is a CSS example:

BODY { background: COLSET0_BACKGROUND; color: COLSET0_FOREGROUND; }

.sidebar { background: COLSET1_BACKGROUND; color: COLSET1_FOREGROUND; }

This gives the "sidebar" class a different colour set to the main page.

ERROR MESSAGES ^

    Can't call method "as_rgb_string" on an undefined value

This usually means that there is a COLSET tag in an input file, which is referring to a colour-set which doesn't exist. Try increasing the value of the 'numsets' option.

    Can't call method "as_hex_string" on an undefined value

This is the same as the above, only it happens when the 'traditional' option is given as well.

    Can't exec "date": No such file or directory

This happens if you try to use the '--huetype date' option and don't have the "date" command on your system.

REQUIRES ^

    Getopt::Long
    Pod::Usage
    Getopt::ArgvFile
    Graphics::Colourset;

SEE ALSO ^

perl(1) Getopt::Long Getopt::ArgvFile Pod::Usage

BUGS ^

Please report any bugs or feature requests to the author.

AUTHOR ^

    Kathryn Andersen (RUBYKAT)
    perlkat AT katspace dot com
    http://www.katspace.com

COPYRIGHT AND LICENCE ^

Copyright (c) 2005 by Kathryn Andersen

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: