Graphics::Color(3pm)

πŸ“¦
version 0.31 Β· 2 versions
  • 0.31 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.31 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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>


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