Color-Scheme-1.07/000755 000767 000024 00000000000 12504006066 014025 5ustar00rjbsstaff000000 000000 Color-Scheme-1.07/Changes000644 000767 000024 00000001735 12504006066 015326 0ustar00rjbsstaff000000 000000 Revision history for Color-Scheme 1.07 2015-03-23 08:50:59-04:00 America/New_York - allow for single-bit imprecision in color parts, as perl 5.21.x has changed its rounding in some cases (with long doubles) 1.06 2014-02-13 14:31:19-05:00 America/New_York typo fixes (thanks, Yanick!) 1.05 2013-07-01 20:59:24 America/New_York repackage, update bugtracker, etc. 1.04 Tue Jan 1 15:14:44 EST 2013 fix some documentation typos (thanks, Xavier Guimard) 1.03 Mon Jun 18 17:56:43 EDT 2012 stop the pod tests from breaking install 1.02 Sat Jan 28 20:06:21 EST 2006 Fixed from_hue bug thanks to Christoffer Vig 1.01 Mon Nov 14 22:34:35 EST 2005 Changed license to same as Perl with explicit permission from Color Schemes 2 author Reorganized docs a little 1.00 Sun Nov 13 16:13:50 EST 2005 First version, released on an unsuspecting world. Color-Scheme-1.07/dist.ini000644 000767 000024 00000000234 12504006066 015470 0ustar00rjbsstaff000000 000000 name = Color-Scheme author = Ian Langworth license = Perl_5 copyright_holder = Ian Langworth copyright_year = 2005 [@RJBS] Color-Scheme-1.07/lib/000755 000767 000024 00000000000 12504006066 014573 5ustar00rjbsstaff000000 000000 Color-Scheme-1.07/LICENSE000644 000767 000024 00000043660 12504006066 015043 0ustar00rjbsstaff000000 000000 This software is copyright (c) 2005 by Ian Langworth. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2005 by Ian Langworth. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2005 by Ian Langworth. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Color-Scheme-1.07/Makefile.PL000644 000767 000024 00000002533 12504006066 016002 0ustar00rjbsstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.034. use strict; use warnings; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "generate pleasant color schemes", "AUTHOR" => "Ian Langworth ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Color-Scheme", "EXE_FILES" => [], "LICENSE" => "perl", "NAME" => "Color::Scheme", "PREREQ_PM" => { "Carp" => 0, "List::Util" => "1.14", "POSIX" => "1.08", "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "Exporter" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Test::More" => "0.96", "parent" => 0 }, "VERSION" => "1.07", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Exporter" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "List::Util" => "1.14", "POSIX" => "1.08", "Test::More" => "0.96", "parent" => 0, "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Color-Scheme-1.07/MANIFEST000644 000767 000024 00000000532 12504006066 015156 0ustar00rjbsstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.034. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Color/Scheme.pm t/00-report-prereqs.dd t/00-report-prereqs.t t/colors.t t/colors2.t t/lib/ColorTest.pm t/synopsis.t t/three-sixty.t xt/release/changes_has_content.t xt/release/pod-syntax.t Color-Scheme-1.07/META.json000644 000767 000024 00000041410 12504006066 015446 0ustar00rjbsstaff000000 000000 { "abstract" : "generate pleasant color schemes", "author" : [ "Ian Langworth " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.034, CPAN::Meta::Converter version 2.150001", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Color-Scheme", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Test::Pod" : "1.41" } }, "runtime" : { "requires" : { "Carp" : "0", "List::Util" : "1.14", "POSIX" : "1.08", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "Exporter" : "0", "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "Test::More" : "0.96", "parent" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/rjbs/Color-Scheme/issues" }, "homepage" : "https://github.com/rjbs/Color-Scheme", "repository" : { "type" : "git", "url" : "https://github.com/rjbs/Color-Scheme.git", "web" : "https://github.com/rjbs/Color-Scheme" } }, "version" : "1.07", "x_Dist_Zilla" : { "perl" : { "version" : "5.021009" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : "0", "include_dotfiles" : "0", "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : "0" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@RJBS/Git::GatherDir", "version" : "2.031" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RJBS/CheckPrereqsIndexed", "version" : "0.015" }, { "class" : "Dist::Zilla::Plugin::CheckExtraTests", "name" : "@RJBS/CheckExtraTests", "version" : "0.025" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::RJBS" ], "phase" : "build", "skip" : [] } }, "name" : "@RJBS/RJBS-Outdated", "version" : "0.040" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : "1", "check_all_prereqs" : 0, "modules" : [], "phase" : "release", "skip" : [] } }, "name" : "@RJBS/CPAN-Outdated", "version" : "0.040" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RJBS/@Filter/PruneCruft", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@RJBS/@Filter/ManifestSkip", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RJBS/@Filter/MetaYAML", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RJBS/@Filter/License", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@RJBS/@Filter/Readme", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RJBS/@Filter/ExecDir", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RJBS/@Filter/ShareDir", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RJBS/@Filter/Manifest", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RJBS/@Filter/TestRelease", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RJBS/@Filter/ConfirmRelease", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RJBS/@Filter/UploadToCPAN", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@RJBS/MakeMaker", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RJBS/AutoPrereqs", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "0.001", "version_by_branch" : "0", "version_regexp" : "(?^:^([0-9]+\\.[0-9]+)$)" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@RJBS/Git::NextVersion", "version" : "2.031" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@RJBS/PkgVersion", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RJBS/MetaConfig", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RJBS/MetaJSON", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RJBS/NextRelease", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@RJBS/Test::ChangesHasContent", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RJBS/PodSyntaxTests", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@RJBS/Test::ReportPrereqs", "version" : "0.020" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@RJBS/TestMoreWithSubtests", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@RJBS" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.010" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.010" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@RJBS/SingleEncoding", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@RJBS/Name", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@RJBS/Version", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/Prelude", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Synopsis", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Description", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Overview", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Stability", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Attributes", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Methods", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Functions", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@RJBS/Leftovers", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/postlude", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@RJBS/Authors", "version" : "4.010" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@RJBS/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@RJBS/Legal", "version" : "4.010" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@RJBS/List", "version" : "4.010" } ] } }, "name" : "@RJBS/PodWeaver", "version" : "4.006" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@RJBS/GithubMeta", "version" : "0.48" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "dist.ini", "Changes" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@RJBS/@Git/Check", "version" : "2.031" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%v%n%n%c", "time_zone" : "local" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "dist.ini", "Changes" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@RJBS/@Git/Commit", "version" : "2.031" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "signed" : 0, "tag" : "1.07", "tag_format" : "%v", "tag_message" : "v%v", "time_zone" : "local" }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@RJBS/@Git/Tag", "version" : "2.031" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin :", "github :" ], "remotes_must_exist" : 0 }, "Dist::Zilla::Role::Git::Repo" : { "repo_root" : "." } }, "name" : "@RJBS/@Git/Push", "version" : "2.031" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "include_authors" : "0", "include_releaser" : "1", "order_by" : "name", "paths" : [] } }, "name" : "@RJBS/Git::Contributors", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "5.034" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "5.034" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "5.034" } }, "x_contributors" : [ "Ian Langworth ", "Ricardo Signes ", "Yanick Champoux " ] } Color-Scheme-1.07/META.yml000644 000767 000024 00000025224 12504006066 015303 0ustar00rjbsstaff000000 000000 --- abstract: 'generate pleasant color schemes' author: - 'Ian Langworth ' build_requires: Exporter: '0' ExtUtils::MakeMaker: '0' File::Spec: '0' Test::More: '0.96' parent: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 5.034, CPAN::Meta::Converter version 2.150001' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Color-Scheme requires: Carp: '0' List::Util: '1.14' POSIX: '1.08' strict: '0' warnings: '0' resources: bugtracker: https://github.com/rjbs/Color-Scheme/issues homepage: https://github.com/rjbs/Color-Scheme repository: https://github.com/rjbs/Color-Scheme.git version: '1.07' x_Dist_Zilla: perl: version: '5.021009' plugins: - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: '0' include_dotfiles: '0' prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: '0' Dist::Zilla::Role::Git::Repo: repo_root: . name: '@RJBS/Git::GatherDir' version: '2.031' - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RJBS/CheckPrereqsIndexed' version: '0.015' - class: Dist::Zilla::Plugin::CheckExtraTests name: '@RJBS/CheckExtraTests' version: '0.025' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::RJBS phase: build skip: [] name: '@RJBS/RJBS-Outdated' version: '0.040' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: '1' check_all_prereqs: 0 modules: [] phase: release skip: [] name: '@RJBS/CPAN-Outdated' version: '0.040' - class: Dist::Zilla::Plugin::PruneCruft name: '@RJBS/@Filter/PruneCruft' version: '5.034' - class: Dist::Zilla::Plugin::ManifestSkip name: '@RJBS/@Filter/ManifestSkip' version: '5.034' - class: Dist::Zilla::Plugin::MetaYAML name: '@RJBS/@Filter/MetaYAML' version: '5.034' - class: Dist::Zilla::Plugin::License name: '@RJBS/@Filter/License' version: '5.034' - class: Dist::Zilla::Plugin::Readme name: '@RJBS/@Filter/Readme' version: '5.034' - class: Dist::Zilla::Plugin::ExecDir name: '@RJBS/@Filter/ExecDir' version: '5.034' - class: Dist::Zilla::Plugin::ShareDir name: '@RJBS/@Filter/ShareDir' version: '5.034' - class: Dist::Zilla::Plugin::Manifest name: '@RJBS/@Filter/Manifest' version: '5.034' - class: Dist::Zilla::Plugin::TestRelease name: '@RJBS/@Filter/TestRelease' version: '5.034' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RJBS/@Filter/ConfirmRelease' version: '5.034' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RJBS/@Filter/UploadToCPAN' version: '5.034' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@RJBS/MakeMaker' version: '5.034' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RJBS/AutoPrereqs' version: '5.034' - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '0.001' version_by_branch: '0' version_regexp: (?^:^([0-9]+\.[0-9]+)$) Dist::Zilla::Role::Git::Repo: repo_root: . name: '@RJBS/Git::NextVersion' version: '2.031' - class: Dist::Zilla::Plugin::PkgVersion name: '@RJBS/PkgVersion' version: '5.034' - class: Dist::Zilla::Plugin::MetaConfig name: '@RJBS/MetaConfig' version: '5.034' - class: Dist::Zilla::Plugin::MetaJSON name: '@RJBS/MetaJSON' version: '5.034' - class: Dist::Zilla::Plugin::NextRelease name: '@RJBS/NextRelease' version: '5.034' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@RJBS/Test::ChangesHasContent' version: '0.007' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RJBS/PodSyntaxTests' version: '5.034' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@RJBS/Test::ReportPrereqs' version: '0.020' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@RJBS/TestMoreWithSubtests' version: '5.034' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@RJBS' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.010' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.010' - class: Pod::Weaver::Plugin::SingleEncoding name: '@RJBS/SingleEncoding' version: '4.010' - class: Pod::Weaver::Section::Name name: '@RJBS/Name' version: '4.010' - class: Pod::Weaver::Section::Version name: '@RJBS/Version' version: '4.010' - class: Pod::Weaver::Section::Region name: '@RJBS/Prelude' version: '4.010' - class: Pod::Weaver::Section::Generic name: '@RJBS/Synopsis' version: '4.010' - class: Pod::Weaver::Section::Generic name: '@RJBS/Description' version: '4.010' - class: Pod::Weaver::Section::Generic name: '@RJBS/Overview' version: '4.010' - class: Pod::Weaver::Section::Generic name: '@RJBS/Stability' version: '4.010' - class: Pod::Weaver::Section::Collect name: Attributes version: '4.010' - class: Pod::Weaver::Section::Collect name: Methods version: '4.010' - class: Pod::Weaver::Section::Collect name: Functions version: '4.010' - class: Pod::Weaver::Section::Leftovers name: '@RJBS/Leftovers' version: '4.010' - class: Pod::Weaver::Section::Region name: '@RJBS/postlude' version: '4.010' - class: Pod::Weaver::Section::Authors name: '@RJBS/Authors' version: '4.010' - class: Pod::Weaver::Section::Contributors name: '@RJBS/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@RJBS/Legal' version: '4.010' - class: Pod::Weaver::Plugin::Transformer name: '@RJBS/List' version: '4.010' name: '@RJBS/PodWeaver' version: '4.006' - class: Dist::Zilla::Plugin::GithubMeta name: '@RJBS/GithubMeta' version: '0.48' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - dist.ini - Changes allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . name: '@RJBS/@Git/Check' version: '2.031' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%v%n%n%c time_zone: local Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - dist.ini - Changes allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: repo_root: . name: '@RJBS/@Git/Commit' version: '2.031' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ signed: 0 tag: '1.07' tag_format: '%v' tag_message: v%v time_zone: local Dist::Zilla::Role::Git::Repo: repo_root: . name: '@RJBS/@Git/Tag' version: '2.031' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - 'origin :' - 'github :' remotes_must_exist: 0 Dist::Zilla::Role::Git::Repo: repo_root: . name: '@RJBS/@Git/Push' version: '2.031' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: include_authors: '0' include_releaser: '1' order_by: name paths: [] name: '@RJBS/Git::Contributors' version: '0.011' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '5.034' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '5.034' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '5.034' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '5.034' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '5.034' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '5.034' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '5.034' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '5.034' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '5.034' x_contributors: - 'Ian Langworth ' - 'Ricardo Signes ' - 'Yanick Champoux ' Color-Scheme-1.07/README000644 000767 000024 00000000560 12504006066 014706 0ustar00rjbsstaff000000 000000 This archive contains the distribution Color-Scheme, version 1.07: generate pleasant color schemes This software is copyright (c) 2005 by Ian Langworth. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v5.034. Color-Scheme-1.07/t/000755 000767 000024 00000000000 12504006066 014270 5ustar00rjbsstaff000000 000000 Color-Scheme-1.07/xt/000755 000767 000024 00000000000 12504006066 014460 5ustar00rjbsstaff000000 000000 Color-Scheme-1.07/xt/release/000755 000767 000024 00000000000 12504006066 016100 5ustar00rjbsstaff000000 000000 Color-Scheme-1.07/xt/release/changes_has_content.t000644 000767 000024 00000002010 12504006066 022253 0ustar00rjbsstaff000000 000000 #!perl use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '1.07'; my $trial_token = '-TRIAL'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; # _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit # by Jerome Quelin sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } Color-Scheme-1.07/xt/release/pod-syntax.t000644 000767 000024 00000000220 12504006066 020365 0ustar00rjbsstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Color-Scheme-1.07/t/00-report-prereqs.dd000644 000767 000024 00000002502 12504006066 020007 0ustar00rjbsstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0' } }, 'develop' => { 'requires' => { 'Test::Pod' => '1.41' } }, 'runtime' => { 'requires' => { 'Carp' => '0', 'List::Util' => '1.14', 'POSIX' => '1.08', 'strict' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'Exporter' => '0', 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'Test::More' => '0.96', 'parent' => '0' } } }; $x; }Color-Scheme-1.07/t/00-report-prereqs.t000644 000767 000024 00000012731 12504006066 017670 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.020 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do 't/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; if ( $source && $HAS_CPAN_META ) { if ( my $meta = eval { CPAN::Meta->load_file($source) } ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } } else { $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( @dep_errors ) { diag join("\n", "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n", "The following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: Color-Scheme-1.07/t/colors.t000644 000767 000024 00000002421 12504006066 015755 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use Test::More; use Color::Scheme; use t::lib::ColorTest; { my $c = Color::Scheme->new->from_hex('ff9900')->distance(0.5); my %tests = ( mono => [ qw( ff9900 b36b00 ffe6bf ffcc80 ) ], contrast => [ qw( ff9900 b36b00 ffe6bf ffcc80 0040ff 002db3 bfcfff 809fff ) ], triade => [ qw( ff9900 b36b00 ffe6bf ffcc80 00ffff 00b3b3 bfffff 80ffff 5500ff 3c00b3 d5bfff aa80ff ) ], tetrade => [ qw( ff9900 b36b00 ffe6bf ffcc80 0040ff 002db3 bfcfff 809fff 6b00ff 4b00b3 dabfff b580ff ffe500 b3a000 fff9bf fff280 ) ], analogic => [ qw( ff9900 b36b00 ffe6bf ffcc80 ffcc00 b38f00 fff2bf ffe680 ff6600 b34700 ffd9bf ffb380 ) ], ); while ( my ( $scheme, $colors ) = each %tests ) { color_test( [ $c->scheme($scheme)->colors ], $colors, "$scheme scheme", ); } } done_testing; Color-Scheme-1.07/t/colors2.t000644 000767 000024 00000010005 12504006066 016034 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use Test::More tests => 15; use Color::Scheme; use t::lib::ColorTest; { my $scheme = Color::Scheme->new; color_test( [ $scheme->colors ], [ 'ff9900', 'b36b00', 'ffe6bf', 'ffcc80' ], 'simple' ); $scheme->from_hex('ff0000'); color_test( [ $scheme->colors ], [ 'ff0000', 'b30000', 'ffbfbf', 'ff8080' ], 'red hex' ); $scheme->from_hue(230); color_test( [ $scheme->colors ], [ '0074ff', '0051b3', 'bfdcff', '80b9ff' ], 'set hue to 230' ); $scheme->scheme('analogic'); color_test( [ $scheme->colors ], [ '0074ff', '0051b3', 'bfdcff', '80b9ff', '331aff', '2412b3', 'ccc6ff', '998cff', '00ffb3', '00b37d', 'bfffec', '80ffd9' ], 'analog scheme' ); $scheme->distance(0.3); color_test( [ $scheme->colors ], [ '0074ff', '0051b3', 'bfdcff', '80b9ff', '1132ff', '0c23b3', 'c4ccff', '8898ff', '00efff', '00a7b3', 'bffbff', '80f7ff' ], 'tweak distance' ); $scheme->add_complement(1); color_test( [ $scheme->colors ], [ '0074ff', '0051b3', 'bfdcff', '80b9ff', '1132ff', '0c23b3', 'c4ccff', '8898ff', '00efff', '00a7b3', 'bffbff', '80f7ff', 'ff8800', 'b35f00', 'ffe1bf', 'ffc480' ], 'add complement' ); $scheme->variation('pale'); color_test( [ $scheme->colors ], [ '8e969e', '737980', 'e6f1ff', 'acb5bf', '9395a3', '747580', 'e7eaff', 'adb0bf', '778384', '737f80', 'e6fdff', 'acbebf', 'd9cfc3', '807a73', 'fff3e6', 'bfb6ac' ], 'pale variation' ); $scheme->web_safe(1); color_test( [ $scheme->colors ], [ '999999', '666699', 'ffffff', '99cccc', '999999', '666699', 'ffffff', '9999cc', '669999', '666699', 'ffffff', '99cccc', 'cccccc', '996666', 'ffffff', 'cccc99' ], 'web safe' ); } { my $scheme = Color::Scheme->new; $scheme->from_hue(15); $scheme->scheme('contrast'); color_test( [ $scheme->colors ], [ 'ff3300', 'b32400', 'ffccbf', 'ff9980', '00b366', '007d48', 'bfffe4', '80ffc9' ], 'compl' ); $scheme->scheme('triade'); color_test( [ $scheme->colors ], [ 'ff3300', 'b32400', 'ffccbf', 'ff9980', '33ff00', '24b300', 'ccffbf', '99ff80', '0066b3', '00487d', 'bfe4ff', '80c9ff' ], 'triad' ); $scheme->scheme('tetrade'); color_test( [ $scheme->colors ], [ 'ff3300', 'b32400', 'ffccbf', 'ff9980', '00b366', '007d48', 'bfffe4', '80ffc9', '0033cc', '00248f', 'bfcfff', '809fff', 'ff9900', 'b36b00', 'ffe6bf', 'ffcc80' ], 'tetrad' ); $scheme->variation('pastel'); color_test( [ $scheme->colors ], [ 'e68a73', '804d40', 'e6d3cf', 'bf4d30', '50a17e', '408064', 'cfe6dc', '30bf82', '5c73b8', '405080', 'cfd4e6', '3054bf', 'e6b873', '806640', 'e6dccf', 'bf8630' ], 'pastel' ); $scheme->variation('soft'); color_test( [ $scheme->colors ], [ 'cc9b8f', '806159', 'e6d3cf', 'bf7360', '648f7d', '59806f', 'cfe6dc', '60bf96', '727ea3', '596380', 'cfd4e6', '6078bf', 'ccb48f', '807059', 'e6dccf', 'bf9960' ], 'soft' ); $scheme->variation('light'); color_test( [ $scheme->colors ], [ 'ffccbf', 'bf7360', 'ffebe6', 'ff9980', 'bfffe4', '60bf96', 'e6fff4', '80ffc9', 'bfcfff', '6078bf', 'e6ecff', '809fff', 'ffe6bf', 'bf9960', 'fff5e6', 'ffcc80' ], 'light' ); $scheme->variation('hard'); color_test( [ $scheme->colors ], [ 'ff3300', '991f00', 'ffebe6', 'ff8566', '00b366', '006b3d', 'e6fff4', '66ffbe', '0033cc', '001f7a', 'e6ecff', '668cff', 'ff9900', '995c00', 'fff5e6', 'ffc266' ], 'hard' ); } Color-Scheme-1.07/t/lib/000755 000767 000024 00000000000 12504006066 015036 5ustar00rjbsstaff000000 000000 Color-Scheme-1.07/t/synopsis.t000644 000767 000024 00000002704 12504006066 016347 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use Test::More tests => 8; use Color::Scheme; use t::lib::ColorTest; my @names = qw( scheme1 scheme2 ); my $scheme1 = Color::Scheme->new->from_hex('ff0000')->scheme('analogic') ->distance(0.5)->add_complement(1)->variation('pastel')->web_safe(1); my $scheme2 = Color::Scheme->new->from_hue(0)->scheme('analogic')->distance(0.4) ->add_complement(1)->variation('pastel')->web_safe(1); foreach my $scheme ( $scheme1, $scheme2 ) { my $name = shift @names; my @list = $scheme->colors(); color_test( \@list, [ qw( ff6666 993333 ffcccc cc3333 ff9966 996633 ffcccc cc6633 cc6699 993366 ffcccc cc3399 66cc66 339933 ccffcc 33cc33 ) ], "colors() for $name", ); subtest "colorset output structure" => sub {; my $set = $scheme->colorset(); is(@$set, 4, "four-length array"); ok( (4 == grep { @$_ == 4 } @$set), "...of four-length arrays", ); color_test( [ map { @$_ } @$set ], \@list, "colorset() for $name", ); }; # the docs for colorset() shouldn't lie is( ( $scheme->colors )[1], $scheme->colorset->[0][1], "alternate usage one / $name" ); is( ( $scheme->colors )[5], $scheme->colorset->[1][1], "alternate usage two / $name" ); } Color-Scheme-1.07/t/three-sixty.t000644 000767 000024 00000000727 12504006066 016750 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use Test::More tests => 3; use Color::Scheme; use t::lib::ColorTest; my $scheme = Color::Scheme->new; eval { $scheme->from_hex('e60003'); $scheme->from_hue(360); }; is $@, '', 'no errors'; my @set1 = $scheme->colors; $scheme->from_hue(0); my @set2 = $scheme->colors; $scheme->from_hue(-360); my @set3 = $scheme->colors; color_test( \@set1, \@set2, '360 deg == 0 deg' ); color_test( \@set1, \@set3, '360 deg == -360 deg' ); Color-Scheme-1.07/t/lib/ColorTest.pm000644 000767 000024 00000001504 12504006066 017312 0ustar00rjbsstaff000000 000000 package t::lib::ColorTest; use parent 'Exporter'; our @EXPORT = qw(color_test); use Test::More; my $COLOR_RE; BEGIN { $COLOR_RE = qr/\A([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\z/; } sub color_test { my ($have, $want, $description) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; subtest $description => sub { for my $i (0 .. $#$have) { my $fail; my @have = map {; hex | 1 } ($have->[$i] =~ $COLOR_RE); my @want = map {; hex | 1 } ($want->[$i] =~ $COLOR_RE); die "bogus color <$have->[$i]>" unless @have == 3; die "bogus color <$want->[$i]>" unless @want == 3; ok( ! (grep { $have[$_] != $want[$_] } (0..2)), "color $i: have $have->[$i], want $want->[$i]" ); } }; } 1; Color-Scheme-1.07/lib/Color/000755 000767 000024 00000000000 12504006066 015651 5ustar00rjbsstaff000000 000000 Color-Scheme-1.07/lib/Color/Scheme.pm000644 000767 000024 00000075076 12504006066 017432 0ustar00rjbsstaff000000 000000 use strict; use warnings; package Color::Scheme; # ABSTRACT: generate pleasant color schemes $Color::Scheme::VERSION = '1.07'; use Carp; use List::Util 1.14 qw(min max); use POSIX 1.08 qw(floor); my %SCHEMES = ( map { $_, 1 } qw( mono monochromatic contrast triade tetrade analogic ) ); my %PRESETS = ( # name => [ ? ] default => [ -1, -1, 1, -0.7, 0.25, 1, 0.5, 1 ], pastel => [ 0.5, -0.9, 0.5, 0.5, 0.1, 0.9, 0.75, 0.75 ], soft => [ 0.3, -0.8, 0.3, 0.5, 0.1, 0.9, 0.5, 0.75 ], light => [ 0.25, 1, 0.5, 0.75, 0.1, 1, 0.5, 1 ], hard => [ 1, -1, 1, -0.6, 0.1, 1, 0.6, 1 ], pale => [ 0.1, -0.85, 0.1, 0.5, 0.1, 1, 0.1, 0.75 ], ); my %COLOR_WHEEL = ( # hue => [ red, green, blue, value ] 0 => [ 255, 0, 0, 100 ], 15 => [ 255, 51, 0, 100 ], 30 => [ 255, 102, 0, 100 ], 45 => [ 255, 128, 0, 100 ], 60 => [ 255, 153, 0, 100 ], 75 => [ 255, 178, 0, 100 ], 90 => [ 255, 204, 0, 100 ], 105 => [ 255, 229, 0, 100 ], 120 => [ 255, 255, 0, 100 ], 135 => [ 204, 255, 0, 100 ], 150 => [ 153, 255, 0, 100 ], 165 => [ 51, 255, 0, 100 ], 180 => [ 0, 204, 0, 80 ], 195 => [ 0, 178, 102, 70 ], 210 => [ 0, 153, 153, 60 ], 225 => [ 0, 102, 178, 70 ], 240 => [ 0, 51, 204, 80 ], 255 => [ 25, 25, 178, 70 ], 270 => [ 51, 0, 153, 60 ], 285 => [ 64, 0, 153, 60 ], 300 => [ 102, 0, 153, 60 ], 315 => [ 153, 0, 153, 60 ], 330 => [ 204, 0, 153, 80 ], 345 => [ 229, 0, 102, 90 ], ); sub _round { floor( 0.5 + shift ) } #pod =head1 SYNOPSIS #pod #pod use Color::Scheme; #pod #pod my $scheme = Color::Scheme->new #pod ->from_hex('ff0000') # or ->from_hue(0) #pod ->scheme('analogic') #pod ->distance(0.3) #pod ->add_complement(1) #pod ->variation('pastel') #pod ->web_safe(1) #pod #pod my @list = $scheme->colors(); #pod # @list = ( "999999","666699","ffffff","99cccc", #pod # "999999","666699","ffffff","9999cc", #pod # "669999","666699","ffffff","99cccc", #pod # "cccccc","996666","ffffff","cccc99" ) #pod #pod my $set = $scheme->colorset(); #pod # $set = [ [ "999999","666699","ffffff","99cccc", ], #pod # [ "999999","666699","ffffff","9999cc", ], #pod # [ "669999","666699","ffffff","99cccc", ], #pod # [ "cccccc","996666","ffffff","cccc99" ] ] #pod #pod #pod =head1 DESCRIPTION #pod #pod This module is a Perl implementation of Color Schemes #pod 2 (L), a color scheme generator. #pod Start by visitng the Color Schemes 2 web site and playing with the colors. #pod When you want to generate those schemes on the fly, begin using this module. #pod The descriptions herein don't make too much sense without actually seeing the #pod colorful results. #pod #pod Henceforth, paragraphs in quotes denote documentation copied from Color Schemes 2. #pod #pod "Important note: This tool I (the #pod same HSV/HSB values ie. in Photoshop describe different colors!). The color #pod wheel used here differs from the RGB spectre used on computer screens, it's #pod more in accordance with the classical color theory. This is also why some #pod colors (especially shades of blue) make less bright shades than the basic #pod colors of the RGB-model. In plus, the RGB-model uses red-green-blue as primary #pod colors, but the red-yellow-blue combination is used here. This deformation also #pod causes incompatibility in color conversions from RGB-values. Therefore, the RGB #pod input (eg. the HTML hex values like #F854A9) is not exact, the conversion is #pod rough and sometimes may produce slightly different color." #pod #pod =method new #pod #pod The C method will return a new C object. #pod #pod =cut sub new { my ( $class, @args ) = @_; carp __PACKAGE__ . "::new() doesn't take any arguments" if @args; my @colors; push @colors, Color::Scheme::mutablecolor->new(60) for 1 .. 4; return bless { col => \@colors, scheme => 'mono', distance => 0.5, web_safe => 0, add_complement => 0, }, $class; } #pod =method colors #pod #pod Returns an array of 4, 8, 12 or 16 colors in C hexidecimal notation #pod (without a leading "#") depending on the color scheme and addComplement #pod parameter. For each set of four, the first is usually the most saturated color, #pod the second a darkened version, the third a pale version and fourth #pod a less-pale version. #pod #pod For example: With a contrast scheme, L<"colors()"> would return eight colors. #pod Indexes 1 and 5 could be background colors, 2 and 6 could be foreground colors. #pod #pod Trust me, it's much better if you check out the Color Scheme web site, whose #pod URL is listed in in L<"DESCRIPTION">. #pod #pod =cut sub colors { my ($self) = @_; my $used_colors = 1; my $h = $self->{col}->[0]->get_hue; my %dispatch = ( mono => sub { }, contrast => sub { $used_colors = 2; $self->{col}->[1]->set_hue($h); $self->{col}->[1]->rotate(180); }, triade => sub { $used_colors = 3; my $dif = 60 * $self->{distance}; $self->{col}->[1]->set_hue($h); $self->{col}->[1]->rotate( 180 - $dif ); $self->{col}->[2]->set_hue($h); $self->{col}->[2]->rotate( 180 + $dif ); }, tetrade => sub { $used_colors = 4; my $dif = 90 * $self->{distance}; $self->{col}->[1]->set_hue($h); $self->{col}->[1]->rotate(180); $self->{col}->[2]->set_hue($h); $self->{col}->[2]->rotate( 180 + $dif ); $self->{col}->[3]->set_hue($h); $self->{col}->[3]->rotate($dif); }, analogic => sub { $used_colors = $self->{add_complement} ? 4 : 3; my $dif = 60 * $self->{distance}; $self->{col}->[1]->set_hue($h); $self->{col}->[1]->rotate($dif); $self->{col}->[2]->set_hue($h); $self->{col}->[2]->rotate( 360 - $dif ); $self->{col}->[3]->set_hue($h); $self->{col}->[3]->rotate(180); }, ); $dispatch{monochromatic} = $dispatch{mono}; if ( exists $dispatch{ $self->{scheme} } ) { $dispatch{ $self->{scheme} }->(); } else { croak "unknown color scheme name: " . $self->{scheme}; } my @output; for my $i ( 0 .. $used_colors - 1 ) { for my $j ( 0 .. 3 ) { $output[ $i * 4 + $j ] = $self->{col}->[$i]->get_hex( $self->{web_safe}, $j ); } } return @output; } #pod =method colorset #pod #pod Returns a list of lists of the colors in groups of four. This method simply #pod allows you to reference a color in the scheme by its group isntead of its #pod absolute index in the list of colors. I am assuming that L<"colorset()"> #pod will make it easier to use this module with the templating systems that are #pod out there. #pod #pod For example, if you were to follow the synopsis, say you wanted to retrieve #pod the two darkest colors from the first two groups of the scheme, which is #pod typically the second color in the group. You could retrieve them with #pod L<"colors()">: #pod #pod my $first_background = ($scheme->colors)[1]; #pod my $second_background = ($scheme->colors)[5]; #pod #pod Or, with this method, #pod #pod my $first_background = $scheme->colorset->[0][1]; #pod my $second_background = $scheme->colorset->[1][1]; #pod #pod =cut sub colorset { my ($self) = @_; my @flat_colors = $self->colors; my @grouped_colors; push @grouped_colors, [ splice @flat_colors, 0, 4 ] while @flat_colors; return \@grouped_colors; } #pod =method from_hue #pod #pod $scheme->from_hue( $degrees ) #pod #pod Sets the base color hue, where C is an integer. (Values greater than #pod 359 and less than 0 wrap back around the wheel.) #pod #pod The default base hue is 0, or bright red. #pod #pod =cut sub from_hue { my ( $self, $h ) = @_; croak "variation needs an argument" unless defined $h; $self->{col}->[0]->set_hue($h); return $self; } #pod =method from_hex #pod #pod $scheme->from_hex( $color ) #pod #pod Sets the base color to the given color, where C is in the hexidecimal #pod form RRGGBB. C should not be preceded with a hash (#). #pod #pod The default base color is the equivalent of #ff0000, or bright red. #pod #pod =cut sub from_hex { my ( $self, $hex ) = @_; croak "from_hex needs an argument" unless defined $hex; croak "from_hex($hex) - argument must be in the form of RRGGBB" unless $hex =~ / ^ ( [0-9A-F]{2} ) {3} $ /ismx; $hex =~ m/(..)(..)(..)/; my ( $r, $g, $b ) = map {hex} ( $1, $2, $3 ); my $rgb2hsv = sub { my ( $r, $g, $b ) = @_; my $min = min( $r, $g, $b ); my $max = max( $r, $g, $b ); my $d = $max - $min; my $v = $max; my $s = ( $d > 0 ) ? ( $d / $max ) : return ( 0, 0, $v ); my $h = ( $r == $max ) ? ( ( $g - $b ) / $d ) : ( $g == $max ) ? ( 2 + ( $b - $r ) / $d ) : ( 4 + ( $r - $g ) / $d ); $h *= 60; $h %= 360; return ( $h, $s, $v ); }; my @hsv = $rgb2hsv->( map { $_ / 255 } ( $r, $g, $b ) ); my $h0 = $hsv[0]; my $h1 = 0; my $h2 = 1000; my ( $i1, $i2, $h, $s, $v ); foreach my $i ( sort keys %COLOR_WHEEL ) { my $c = $COLOR_WHEEL{$i}; my @hsv1 = $rgb2hsv->( map { $_ / 255 } @$c[ 0 .. 2 ] ); $h = $hsv1[0]; if ( $h >= $h1 and $h <= $h0 ) { $h1 = $h; $i1 = $i; } if ( $h <= $h2 and $h >= $h0 ) { $h2 = $h; $i2 = $i; } } if ( $h2 == 0 or $h2 > 360 ) { $h2 = 360; $i2 = 360; } my $k = ( $h2 != $h1 ) ? ( $h0 - $h1 ) / ( $h2 - $h1 ) : 0; $h = _round( $i1 + $k * ( $i2 - $i1 ) ); $h %= 360; $s = $hsv[1]; $v = $hsv[2]; $self->from_hue($h); $self->_set_variant_preset( [ $s, $v, $s, $v * 0.7, $s * 0.25, 1, $s * 0.5, 1 ] ); return $self; } #pod =method add_complement #pod #pod $scheme->add_complement( $bool ) #pod #pod If C<$bool> is true, an extra set of colors will be produced using the #pod complement of the selected color. #pod #pod This only works with the analogic color scheme. The default is false. #pod #pod =cut sub add_complement { my ( $self, $b ) = @_; croak "add_complement needs an argument" unless defined $b; $self->{add_complement} = $b; return $self; } #pod =method web_safe #pod #pod $scheme->web_safe( $bool ) #pod #pod Sets whether the colors returned by L<"colors()"> or L<"colorset()"> will be #pod web-safe. #pod #pod The default is false. #pod #pod =cut sub web_safe { my ( $self, $b ) = @_; croak "web_safe needs an argument" unless defined $b; $self->{web_safe} = $b; return $self; } #pod =method distance #pod #pod $scheme->distance( $float ) #pod #pod C<$float> must be a value from 0 to 1. You might use this with the L<"triade">, #pod L<"tetrade"> or L<"analogic"> color schemes. #pod #pod The default is 0.5. #pod #pod =cut sub distance { my ( $self, $d ) = @_; croak "distance needs an argument" unless defined $d; croak "distance($d) - argument must be >= 0" if $d < 0; croak "distance($d) - argument must be <= 1" if $d > 1; $self->{distance} = $d; return $self; } #pod =method scheme #pod #pod $scheme->scheme( $name ) #pod #pod C<$name> must be a valid color scheme name. See L<"COLOR SCHEMES">. The default #pod is L<"mono">. #pod #pod =cut sub scheme { my ( $self, $name ) = @_; croak "scheme needs an argument" unless defined $name; croak "'$name' isn't a valid scheme name" unless exists $SCHEMES{$name}; $self->{scheme} = $name; return $self; } #pod =method variation #pod #pod $scheme->variation( $name ) #pod #pod C<$name> must be a valid color variation name. See L<"COLOR VARIATIONS">. #pod #pod =cut sub variation { my ( $self, $v ) = @_; croak "variation needs an argument" unless defined $v; croak "'$v' isn't a valid variation name" unless exists $PRESETS{$v}; $self->_set_variant_preset( $PRESETS{$v} ); return $self; } sub _set_variant_preset { my ( $self, $p ) = @_; $self->{col}->[$_]->set_variant_preset($p) for 0 .. 3; } package Color::Scheme::mutablecolor; use Carp; use List::Util qw(min max); use POSIX qw(floor); sub _round { floor( 0.5 + shift ) } sub new { my ( $class, $hue ) = @_; carp "no hue specified" unless defined $hue; my $self = bless { hue => 0, saturation => [], value => [], base_red => 0, base_green => 0, base_blue => 0, base_saturation => 0, base_value => 0, }, $class; $self->set_hue($hue); $self->set_variant_preset( $PRESETS{default} ); return $self; } sub rotate { my ( $self, $angle ) = @_; my $newhue = ( $self->{hue} + $angle ) % 360; $self->set_hue($newhue); } sub get_hue { my ($self) = @_; $self->{hue}; } sub set_hue { my ( $self, $h ) = @_; my $avrg = sub { my ( $a, $b, $k ) = @_; return $a + _round( ( $b - $a ) * $k ); }; $self->{hue} = _round($h) % 360; my $d = $self->{hue} % 15 + ( $self->{hue} - floor( $self->{hue} ) ); my $k = $d / 15; my $derivative1 = $self->{hue} - floor($d); my $derivative2 = ( $derivative1 + 15 ) % 360; my $colorset1 = $COLOR_WHEEL{$derivative1}; my $colorset2 = $COLOR_WHEEL{$derivative2}; my %enum = ( red => 0, green => 1, blue => 2, value => 3 ); while ( my ( $color, $i ) = each %enum ) { $self->{"base_$color"} = $avrg->( $colorset1->[$i], $colorset2->[$i], $k ); } $self->{base_saturation} = $avrg->( 100, 100, $k ) / 100; $self->{base_value} /= 100; } sub get_saturation { my ( $self, $variation ) = @_; my $x = $self->{saturation}->[$variation]; my $s = $x < 0 ? -$x * $self->{base_saturation} : $x; $s = 1 if $s > 1; $s = 0 if $s < 0; return $s; } sub get_value { my ( $self, $variation ) = @_; my $x = $self->{value}->[$variation]; my $v = $x < 0 ? -$x * $self->{base_value} : $x; $v = 1 if $v > 1; $v = 0 if $v < 0; return $v; } sub set_variant { my ( $self, $variation, $s, $v ) = @_; $self->{saturation}->[$variation] = $s; $self->{value}->[$variation] = $v; } sub set_variant_preset { my ( $self, $p ) = @_; $self->set_variant( $_, $p->[ 2 * $_ ], $p->[ 2 * $_ + 1 ] ) for 0 .. 3; } sub get_hex { my ( $self, $web_safe, $variation ) = @_; my $max = max( map { $self->{"base_$_"} } qw( red green blue ) ); my $min = min( map { $self->{"base_$_"} } qw( red green blue ) ); my $v = ( $variation < 0 ? $self->{base_value} : $self->get_value($variation) ) * 255; my $s = ( $variation < 0 ? $self->{base_saturation} : $self->get_saturation($variation) ); my $k = $max > 0 ? $v / $max : 0; my @rgb = map { min( 255, _round( $v - ( $v - $self->{"base_$_"} * $k ) * $s ) ) } qw( red green blue ); @rgb = map { _round( $_ / 51 ) * 51 } @rgb if $web_safe; return sprintf( '%02x' x @rgb, @rgb ); } #pod =head1 COLOR SCHEMES #pod #pod The following documentation is adapated (and mostly copied verbatim) from the #pod Color Schemes 2 help. Use one of these scheme names as an argument to the #pod L<"scheme()"> method. #pod #pod =head2 monochromatic (or mono) #pod #pod "Monochormatic scheme is based on only one color tint, and uses only variations #pod made by changing its saturation and brightness. Black and white colors are #pod always added. The result is comfortable for eyes, even when using aggressive #pod color. However, it's harder to find accents and highlights. #pod #pod "The application makes only several monochromatic variants of each color. You'll #pod be able to make others - more or less saturated, lighter or darker. #pod Monochromatic variations are made for each color in other schemes, too." #pod #pod =head2 contrast #pod #pod "Base color is supplemented with its complement (color on the opposite side of #pod the wheel). One warm and one cold color is always created - we have to #pod consider, which one will be dominant, and if the result should look warm, or #pod cold. Suitable monochromatic variations of this two colors may be added to the #pod scheme." #pod #pod =head2 triade #pod #pod "Base color is supplemented with two colors, placed identically on both sides of #pod its complement. Unlike the 'sharp' contrast, this scheme is often more #pod comfortable for the eyes, it's softer, and has more space for balancing warm #pod and cold colors. #pod #pod "You can use the L<"distance()"> method to set the distance of these colors #pod from the base color complement. The less the value is, the closer the colors #pod are to the contrast color, and are more similar. The best value is between 0.25 #pod and 0.5. Higher values aren't too suitable - except the shift by 60E<0x00B0>, #pod which makes another color scheme, the triade: #pod #pod "The triade is made by three colors evenly distributed on the thirds of the #pod color wheel (by 120 degrees). The triade-schemes are vibrating, full of energy, #pod and have large space to make contrasts, accents and to balance warm and cold #pod colors. You can make the triade in the 'soft contrast' scheme setting the #pod distance to the maximal value, 1." #pod #pod =head2 tetrade #pod #pod "This scheme, also known as 'double-contrast,' is made by a pair of colors and #pod their complements. It's based on the tetrade - the foursome of colors evenly #pod distributed on the fourths of the color wheel (by 90 degreees). The tetrade is #pod very aggressive color scheme, requiring very good planning and very sensitive #pod approach to relations of these colors. #pod #pod "Less distance between two base colors causes less tension in the result. #pod However, this scheme is always more 'nervous' and 'action' than other schemes. #pod While working with it, we have to take care especially of relations between one #pod color and the complement of its adjacent color - in case of the tetrade #pod (maximum distance 1), good feeling and very sensitive approach are necessary." #pod #pod =head2 analogic #pod #pod "This scheme is made by base color and its adjacent colors - two colors #pod identically on both sides. It always looks very elegantly and clear, the result #pod has less tension and it's uniformly warm, or cold. If a color on the warm-cold #pod border is chosen, the color with opposite 'temperature' may be used for #pod accenting the other two colors. #pod #pod "You can set the distance of adjacent colors by using L<"distance()">. Values #pod between 0.25 and 0.5 (15-30 degrees on the wheel) are optimal. You can also add #pod the contrast color; the scheme is then supplemented with the complement of the #pod base color. It must be treated only as a complement - it adds tension to the #pod palette, and it's too aggressive when overused. However, used in details and as #pod accent of main colors, it can be very effective and elegant." #pod #pod =head1 COLOR VARIATIONS #pod #pod "Each of colors in displayed scheme has four variations. These are colors of #pod the same hue, but they differ in the saturation and brightness. ... The very #pod first variation ... is the base variation, which determines the look of the #pod scheme. The other three variations are just additional. Iff the scheme is made #pod by less than four colors, the unused place is used to display variations (or #pod the complement) of the base color." #pod #pod Use one of these variation names as an argument to the L<"variation()"> method. #pod #pod =head2 default #pod #pod The default preset. Generally pretty nice. #pod #pod =head2 pastel #pod #pod Softer colors with added whiteness. #pod #pod =head2 soft #pod #pod Darker pastel colors. #pod #pod =head2 light #pod #pod Very light, almost washed-out colors. #pod #pod =head2 hard #pod #pod Deeper, more-saturated colors. #pod #pod =head2 pale #pod #pod Greyer, less-saturated colors. #pod #pod =head1 CREDIT #pod #pod Color Schemes 2, its documentation and original JavaScript code are copyright #pod pixy L #pod #pod The author has explicitly granted license for this distribution of code to be #pod redistribute as specified in the L section. #pod #pod =cut 1; __END__ =pod =encoding UTF-8 =head1 NAME Color::Scheme - generate pleasant color schemes =head1 VERSION version 1.07 =head1 SYNOPSIS use Color::Scheme; my $scheme = Color::Scheme->new ->from_hex('ff0000') # or ->from_hue(0) ->scheme('analogic') ->distance(0.3) ->add_complement(1) ->variation('pastel') ->web_safe(1) my @list = $scheme->colors(); # @list = ( "999999","666699","ffffff","99cccc", # "999999","666699","ffffff","9999cc", # "669999","666699","ffffff","99cccc", # "cccccc","996666","ffffff","cccc99" ) my $set = $scheme->colorset(); # $set = [ [ "999999","666699","ffffff","99cccc", ], # [ "999999","666699","ffffff","9999cc", ], # [ "669999","666699","ffffff","99cccc", ], # [ "cccccc","996666","ffffff","cccc99" ] ] =head1 DESCRIPTION This module is a Perl implementation of Color Schemes 2 (L), a color scheme generator. Start by visitng the Color Schemes 2 web site and playing with the colors. When you want to generate those schemes on the fly, begin using this module. The descriptions herein don't make too much sense without actually seeing the colorful results. Henceforth, paragraphs in quotes denote documentation copied from Color Schemes 2. "Important note: This tool I (the same HSV/HSB values ie. in Photoshop describe different colors!). The color wheel used here differs from the RGB spectre used on computer screens, it's more in accordance with the classical color theory. This is also why some colors (especially shades of blue) make less bright shades than the basic colors of the RGB-model. In plus, the RGB-model uses red-green-blue as primary colors, but the red-yellow-blue combination is used here. This deformation also causes incompatibility in color conversions from RGB-values. Therefore, the RGB input (eg. the HTML hex values like #F854A9) is not exact, the conversion is rough and sometimes may produce slightly different color." =head1 METHODS =head2 new The C method will return a new C object. =head2 colors Returns an array of 4, 8, 12 or 16 colors in C hexidecimal notation (without a leading "#") depending on the color scheme and addComplement parameter. For each set of four, the first is usually the most saturated color, the second a darkened version, the third a pale version and fourth a less-pale version. For example: With a contrast scheme, L<"colors()"> would return eight colors. Indexes 1 and 5 could be background colors, 2 and 6 could be foreground colors. Trust me, it's much better if you check out the Color Scheme web site, whose URL is listed in in L<"DESCRIPTION">. =head2 colorset Returns a list of lists of the colors in groups of four. This method simply allows you to reference a color in the scheme by its group isntead of its absolute index in the list of colors. I am assuming that L<"colorset()"> will make it easier to use this module with the templating systems that are out there. For example, if you were to follow the synopsis, say you wanted to retrieve the two darkest colors from the first two groups of the scheme, which is typically the second color in the group. You could retrieve them with L<"colors()">: my $first_background = ($scheme->colors)[1]; my $second_background = ($scheme->colors)[5]; Or, with this method, my $first_background = $scheme->colorset->[0][1]; my $second_background = $scheme->colorset->[1][1]; =head2 from_hue $scheme->from_hue( $degrees ) Sets the base color hue, where C is an integer. (Values greater than 359 and less than 0 wrap back around the wheel.) The default base hue is 0, or bright red. =head2 from_hex $scheme->from_hex( $color ) Sets the base color to the given color, where C is in the hexidecimal form RRGGBB. C should not be preceded with a hash (#). The default base color is the equivalent of #ff0000, or bright red. =head2 add_complement $scheme->add_complement( $bool ) If C<$bool> is true, an extra set of colors will be produced using the complement of the selected color. This only works with the analogic color scheme. The default is false. =head2 web_safe $scheme->web_safe( $bool ) Sets whether the colors returned by L<"colors()"> or L<"colorset()"> will be web-safe. The default is false. =head2 distance $scheme->distance( $float ) C<$float> must be a value from 0 to 1. You might use this with the L<"triade">, L<"tetrade"> or L<"analogic"> color schemes. The default is 0.5. =head2 scheme $scheme->scheme( $name ) C<$name> must be a valid color scheme name. See L<"COLOR SCHEMES">. The default is L<"mono">. =head2 variation $scheme->variation( $name ) C<$name> must be a valid color variation name. See L<"COLOR VARIATIONS">. =head1 COLOR SCHEMES The following documentation is adapated (and mostly copied verbatim) from the Color Schemes 2 help. Use one of these scheme names as an argument to the L<"scheme()"> method. =head2 monochromatic (or mono) "Monochormatic scheme is based on only one color tint, and uses only variations made by changing its saturation and brightness. Black and white colors are always added. The result is comfortable for eyes, even when using aggressive color. However, it's harder to find accents and highlights. "The application makes only several monochromatic variants of each color. You'll be able to make others - more or less saturated, lighter or darker. Monochromatic variations are made for each color in other schemes, too." =head2 contrast "Base color is supplemented with its complement (color on the opposite side of the wheel). One warm and one cold color is always created - we have to consider, which one will be dominant, and if the result should look warm, or cold. Suitable monochromatic variations of this two colors may be added to the scheme." =head2 triade "Base color is supplemented with two colors, placed identically on both sides of its complement. Unlike the 'sharp' contrast, this scheme is often more comfortable for the eyes, it's softer, and has more space for balancing warm and cold colors. "You can use the L<"distance()"> method to set the distance of these colors from the base color complement. The less the value is, the closer the colors are to the contrast color, and are more similar. The best value is between 0.25 and 0.5. Higher values aren't too suitable - except the shift by 60E<0x00B0>, which makes another color scheme, the triade: "The triade is made by three colors evenly distributed on the thirds of the color wheel (by 120 degrees). The triade-schemes are vibrating, full of energy, and have large space to make contrasts, accents and to balance warm and cold colors. You can make the triade in the 'soft contrast' scheme setting the distance to the maximal value, 1." =head2 tetrade "This scheme, also known as 'double-contrast,' is made by a pair of colors and their complements. It's based on the tetrade - the foursome of colors evenly distributed on the fourths of the color wheel (by 90 degreees). The tetrade is very aggressive color scheme, requiring very good planning and very sensitive approach to relations of these colors. "Less distance between two base colors causes less tension in the result. However, this scheme is always more 'nervous' and 'action' than other schemes. While working with it, we have to take care especially of relations between one color and the complement of its adjacent color - in case of the tetrade (maximum distance 1), good feeling and very sensitive approach are necessary." =head2 analogic "This scheme is made by base color and its adjacent colors - two colors identically on both sides. It always looks very elegantly and clear, the result has less tension and it's uniformly warm, or cold. If a color on the warm-cold border is chosen, the color with opposite 'temperature' may be used for accenting the other two colors. "You can set the distance of adjacent colors by using L<"distance()">. Values between 0.25 and 0.5 (15-30 degrees on the wheel) are optimal. You can also add the contrast color; the scheme is then supplemented with the complement of the base color. It must be treated only as a complement - it adds tension to the palette, and it's too aggressive when overused. However, used in details and as accent of main colors, it can be very effective and elegant." =head1 COLOR VARIATIONS "Each of colors in displayed scheme has four variations. These are colors of the same hue, but they differ in the saturation and brightness. ... The very first variation ... is the base variation, which determines the look of the scheme. The other three variations are just additional. Iff the scheme is made by less than four colors, the unused place is used to display variations (or the complement) of the base color." Use one of these variation names as an argument to the L<"variation()"> method. =head2 default The default preset. Generally pretty nice. =head2 pastel Softer colors with added whiteness. =head2 soft Darker pastel colors. =head2 light Very light, almost washed-out colors. =head2 hard Deeper, more-saturated colors. =head2 pale Greyer, less-saturated colors. =head1 CREDIT Color Schemes 2, its documentation and original JavaScript code are copyright pixy L The author has explicitly granted license for this distribution of code to be redistribute as specified in the L section. =head1 AUTHOR Ian Langworth =head1 CONTRIBUTORS =for stopwords Ian Langworth Ricardo Signes Yanick Champoux =over 4 =item * Ian Langworth =item * Ricardo Signes =item * Yanick Champoux =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2005 by Ian Langworth. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut