colourset - substitute certain tags with generated colour names.
This describes version 0.01 of colourset.
colourset --help | --manpage | --version
colourset --hue number --numsets number [ --huetype hue-type ] [ --shade number ] [ --traditional ] file ...
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.
Print help message and exit.
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).
This determines how to interpret the 'hue' option.
Take the hue as given, and use that value.
Ignore the hue value and generate a random hue.
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.
Print the full help documentation (manual page) and exit.
The number of coloursets to generate.
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.
Make the colours be output in traditional #nnnnnn notation rather than the more modern rgb:nn/nn/nn notation.
Print version information and exit.
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:
The background colour is the main colour of the colourset, to be used for the background of the "component" (whatever that may be).
The topshadow colour is a colour slightly lighter than the background colour, suitable for using to define a "top shadow" colour.
The bottomshadow colour is a colour slightly darker than the background colour, suitable for using to define a "bottom shadow" colour.
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.
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.
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.
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.
Getopt::Long Pod::Usage Getopt::ArgvFile Graphics::Colourset;
perl(1) Getopt::Long Getopt::ArgvFile Pod::Usage
Please report any bugs or feature requests to the author.
Kathryn Andersen (RUBYKAT) perlkat AT katspace dot com http://www.katspace.com
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.
To install Graphics::Colourset, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Graphics::Colourset
CPAN shell
perl -MCPAN -e shell install Graphics::Colourset
For more information on module installation, please visit the detailed CPAN module installation guide.