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