Graphi...r::HSL(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::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,ALPHA
  • as_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. Returns 1 if true, else 0; so very binary of her.
  • not_equal_to β€” The opposite of equal_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. πŸ’


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