Mail::...::Color(3pm)
π Mail::...::Color(3pm) π
okay bestie so this is a page from the User Contributed Perl Documentation, and it's all about a lil class called Mail::SpamAssassin::HTML::Color β yes the manual is filed under Mail::...::Color(3pm) because apparently we're being mysterious today π
β¨ NAME β¨
Mail::SpamAssassin::HTML::Color β a class to parse and manipulate CSS color values π¨
π SYNOPSIS π
use Mail::SpamAssassin::HTML::Color;
my $color = Mail::SpamAssassin::HTML::Color->new('rgba(255, 0, 153, 0.5)');
$color->blend([255, 255, 255]);
my $distance = $color->distance([0, 0, 0]);
print "$color"; # Outputs the color as a hex string
not me looking at this and being like "oh she's cute, she's an object" π it's giving one-liner setup, zero chaos, we love that for us
π DESCRIPTION π
This class is your new bestie for all things CSS color π She'll parse a whole bunch of different CSS color formats, blend them against a background color, do the math to figure out how far apart two colors are, and turn the whole thing into a hex string. Lowkey iconic behaviour, no cap.
π¦ METHODS π¦
πΈ new($color)
Creates a brand new color object out of a CSS color string. Give her the string, she gives you the whole entire object. periodt.
π
blend($background)
Blends the color with the background color you hand her. Heads up bestie: this one modifies the color in-place β she's not making a copy, she's editing this object right here β and then she returns the modified object back to you. so like, don't be surprised when your original color has changed its whole vibe π
π§ distance($other_color)
Calculates the distance between the color you've got and another color, using a brightness-weighted geometric formula β¨ it's giving math but make it fashion.
β as_hex
Returns the color as a hex string, with a leading '#' and everything. she's dressed up and ready to go π
π as_array
Returns the color as an array of RGB values. plain, simple, three numbers, main character energy.
bestie reminder: blend changes your color in place β that's not a bug, that's just how she moves π
and that's the whole page fr fr π«Ά this gem came from perl v5.40.1, dated 2026-07-23, and it lives at Mail::...::Color(3pm) β go forth and paint the timeline πβ¨
π¦ where this page comes from
- ubuntu stonking: spamassassin 4.0.2+svn1935691-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms