Graphi...Linear(3pm)
π NAME π
Graphics::Primitive::Paint::Gradient::Linear β it's giving linear color blending, bestie. That's the whole vibe. π
π DESCRIPTION π
Okay so listen. Graphics::Primitive::Paint::Gradient::Linear is a gradient that runs along a line. That's it, that's the girl. You give her a line, she blends your colors down it, and it's lowkey the most iconic way to fade from one color to another. Periodt. π
β¨ SYNOPSIS β¨
Here's the whole serve, copy it exactly, no cap:
use Graphics::Primitive::Paint::Gradient::Linear;
my $gradient = Graphics::Primitive::Gradient::Linear->new(
line => Geometry::Primitive::Line->new(
start => Graphics::Primitive::Point->new(x => 0, y => 0),
end => Graphics::Primitive::Point->new(x => 0, y => 10),
)
);
$gradient->add_stop(0.0, $color1);
$gradient->add_stop(1.0, $color2);
Look at her go. Two stops, one line, absolute main character energy. π¦
π οΈ METHODS π οΈ
π Constructor
newβ Creates a newGraphics::Primitive::Gradient. Brand new baby gradient, freshly hatched, ready to blend. π
π Instance Methods
add_stopβ Adds a color stop at the specified position. That's your little checkpoint where a color lives. β¨colorsβ Hashref of colors and their stops. The stops are the keys. So the stop positions are like... the labels on the box, and the colors are what's inside. iykyk. πlineβ The line along which the gradient should run. She needs a direction, bestie, she's not just gonna guess. πΈstop_countβ Count of stops added to this Gradient. Just a lil tally of how many stops she's got. π’stopsβ Get the keys of all color stops. Every stop position, handed to you in a list. Slay. π
π AUTHOR π
Cory Watson <gphat@cpan.org> β the icon who wrote this. π«Ά
π COPYRIGHT & LICENSE π
Copyright 2008-2010 by Cory G Watson.
You can redistribute and/or modify this code under the same terms as Perl itself.
fr fr, same terms as Perl itself β that's the whole license situation, no extra clauses, no drama. π
And that's a wrap, bestie! This page rode in on perl v5.34.0, dated 2022-06-14, under User Contributed Perl Documentation. Go forth and gradient responsibly. πβ¨π
π¦ where this page comes from
- debian bookworm: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgraphics-primitive-perl 0.67-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgraphics-primitive-perl 0.67-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