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
Color::Theme::Role(3) User Contributed Perl Documentation Color::Theme::Role(3)

Color::Theme::Role - Role for class wanting to support color themes

This document describes version 0.020 of Color::Theme::Role (from Perl distribution Color-Theme-Role), released on 2018-02-25.

This role is for class that wants to support color themes. Color theme is represented as a structure according to the specification described in Color::Theme.

Color theme module. Color themes are put in modules under "Color::Theme::Themes::" (configurable using "color_theme_module_prefix" attribute). Each color theme modules can contain one or more color themes. The module must define a package global variable named %color_themes that contain color themes keyed by their names. Example:

 package MyProject::ColorThemes::Default;

 our %color_themes = (
     no_color => {
         v => 1.1,
         summary => 'Special theme that means no color',
         colors => {
         },
         no_color => 1,
     },

     default => {
         v => 1.1,
         summary => 'Default color theme',
         colors => {
         },
     },
 );

Get/set color theme.

Get/set arguments for color theme. This can be

Each project should have its own class prefix. For example, Text::ANSITable has its color themes in "Text::ANSITable::ColorTheme::" namespace, Data::Dump::Color has them in "Data::Dump::Color::ColorTheme::" and so on.

Will search packages under "color_theme_module_prefix" for color theme modules, then list all color themes for each module. If, for example, the color theme modules found are "MyProject::ColorTheme::Default" and "MyProject::ColorTheme::Extras", will return something like:

 ['Default::theme1', 'Default::theme2', 'Extras::extra3', 'Extras::extra4']

Get color theme hash data structure by name. Note that name must be prefixed by color theme module name (minus the "color_theme_module_prefix").

Get an item's color value from the current color theme (will get from the color theme's "colors" hash, then the $item_name key from that hash). If color value is a coderef, it will be

Like "get_theme_color", but if the resulting color value is a coderef, will call that coderef, passing %args to it and returning the value.

Please visit the project's homepage at <https://metacpan.org/release/Color-Theme-Role>.

Source repository is at <https://github.com/perlancar/perl-Color-Theme-Role>.

Please report any bugs or feature requests on the bugtracker website <https://rt.cpan.org/Public/Dist/Display.html?Name=Color-Theme-Role>

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

Color::Theme

perlancar <perlancar@cpan.org>

This software is copyright (c) 2018 by perlancar@cpan.org.

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

2018-02-25 perl v5.32.1

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.