Graphi...Linear(3pm)

πŸ“¦
version 0.67 Β· 2 versions
  • 0.67 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.67 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 new Graphics::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 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