Graphics::Color(3pm)
π Graphics::Color π
okay bestie, so this is a page from the User Contributed Perl Documentation and it's all about Graphics::Color β device and library agnostic color spaces. no cap. let's get into it β¨
π¦ VERSION π¦
version 0.31 β that's the one, that's the vibe.
πΈ SYNOPSIS πΈ
here's the little taste test, copy it exactly bestie:
my $color = Graphics::Color::RGB->new(
red => .5, green => .5, blue => .5, alpha => .5
);
say $color->as_string;
like... look at her. so clean. π
β¨ DESCRIPTION β¨
so Graphics::Color is a device and library agnostic system for creating and manipulating colors in various color spaces. that's the whole point. she doesn't care what device you're on, she doesn't care what library you're using β she's just here to do colors, and she does them well. periodt. π
π DISCLAIMER π
okay so the author is being SO real here and we love that for them. they say, quote, they're not an art student or a wizard of arcane color knowledge. nope. they're a normal programmer with a penchant for things graphical. π
so because of that, this module is likely incomplete in some places. patches are encouraged! (bestie, if you know things, share them π)
and they've got intentions of adding more color spaces, plus conversion routines (where applicable). so like... watch this space. π
π¨ COLOR TYPES π¨
these are the color types that are supported, and yes we're listing every single one:
- CMYK
- HSL
- HSV
- RGB
- YIQ
- YUV
a whole rainbow of options fr fr π
π οΈ METHODS π οΈ
π§ derive π§
clone this color but let one or more of its attributes change by passing in a hashref of options. it's giving remix. it's giving glow-up. β¨
my $new = $color->derive({ attr => $newvalue });
the returned color will be identical to the cloned one, except for the attributes you specified. that's it. that's the whole deal. π«Ά
β equal_to β
compares this color to the provided one. returns 1 if true, else 0. simple as that bestie.
π not_equal_to π
the opposite of equal_to. literally exactly that. π
π AUTHOR π
Cory G Watson <gphat@cpan.org>
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2014 by Cold Hard Code, LLC.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, honestly. π
okay that's the whole page babes, and just so you know β this was documented with perl v5.34.0, dated 2022-06-14, and it's the manual for Graphics::Color(3pm). now go make something pretty. mwah πβ¨π¦
π¦ where this page comes from
- debian bookworm: libgraphics-color-perl 0.31-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgraphics-color-perl 0.31-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgraphics-color-perl 0.31-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgraphics-color-perl 0.31-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgraphics-color-perl 0.31-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms