Graphi...r::HSL(3pm)
π Graphics::Color::HSL β the manual, but make it cute π
okay bestie, listen. this is Graphics::Color::HSL, a Perl module that lives under the Graphics::Color family (perl's User Contributed Perl Documentation, if you wanna be official about it). it's the HSL color space, and it's lowkey iconic. let's get into it. π
β¨ VERSION β¨
version 0.31 β that's the one, no cap.
π SYNOPSIS π
okay so here's literally the whole vibe, copy-paste ready:
use Graphics::Color::HSL;
my $color = Graphics::Color::HSL->new({
hue => 120,
saturation => .5,
lightness => .25,
});
see how easy that was? you just hand it a hashref with hue, saturation and lightness and boom, you got yourself a color object. main character energy fr. π
π¦ DESCRIPTION π¦
so Graphics::Color::HSL represents a Color in an RGB color space. and HSL? it stands for Hue Saturation and Lightness. that's the whole name, spelled out. it's giving "explain it like I'm five" and honestly? we respect it. π«Ά
πΈ ATTRIBUTES πΈ
these are the lil properties your color object is holding onto. set 'em, get 'em, live your truth. β¨
π· hue
π· h
Set/Get the hue component of this Color. two names, same thing β hue and h are besties who share everything. π§
π· saturation
π· s
Set/Get the saturation component of this Color. (saturation / s, same deal.)
π· lightness
π· l
Set/Get the lightness component of this Color. (lightness / l, you get the pattern by now π)
π· alpha
Set/Get the alpha component of this Color.
π· name
Get the name of this color. and hear me out β this is only valid if the color was created by name. so don't come for it otherwise, okay? π
π METHODS π
the fun part. the girlies. the methods.
as_stringβ Get a string version of this Color, in the form of:HUE,SATURATION,LIGHTNESS,ALPHAas_percent_stringβ Return a percent formatted value for this color. this format is suitable for CSS HSL values, so if you're styling something and need that percent drip, this is her. πas_arrayβ Get the HSL values as an array.as_array_with_alphaβ Get the HSLA values as an array. (yes, with the alpha. she brought a plus-one. π)equal_toβ Compares this color to the provided one. Returns1if true, else0; so very binary of her.not_equal_toβ The opposite ofequal_to. that's it. that's the method. π
π AUTHOR π
Cory G Watson <gphat@cpan.org> β the legend who made this whole thing happen. give them their flowers. π
π 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.
so like, go off, remix it, redistribute it β just keep it on the same terms as Perl 5 itself. the license said what it said. periodt. β¨
and that's the whole page, bestie. this was perl v5.34.0, dated 2022-06-14, and honestly? she ate. now go make something gorgeous with your hues and your lightness. bye pookie ππ¦πΈ
π¦ 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