Graphi...:Brush(3pm)
π Graphics::Primitive::Brush β the perl one, from User Contributed Perl Documentation
okay bestie, gather round, because we're talking about Graphics::Primitive::Brush π
β¨ NAME β¨
Graphics::Primitive::Brush β literally just Description of a stroke. that's it. that's the whole job. a brush is the ink, the stroke, the vibe you leave behind. ποΈ
πΈ DESCRIPTION πΈ
so Graphics::Primitive::Brush represents the visible trace of 'ink' along a path. that's the whole personality. it's the thing that makes your line look like a line instead of just... a concept. π
π¦ SYNOPSIS π¦
here's the vibe, copy-paste it, i won't tell:
use Graphics::Primitive::Brush;
my $stroke = Graphics::Primitive::Brush->new({
line_cap => 'round',
line_join => 'miter',
width => 2
});
look at her. round caps, miter joins, width 2. main character energy fr fr. π
β METHODS β
π Constructor
newβ creates a newGraphics::Primitive::Brush. defaults to a width of1, aline_capof'butt'and aline_joinof'miter'. (yes,'butt'. we don't make the rules, we just document them. π)
π Instance Methods
colorβ set/get this brush's color. that's it, that's the whole thing. π¨dash_patternβ set/get the dash pattern. so a dash pattern is an arrayref of numbers representing the lengths of the various line segments of the dash. even numbered elements are considered opaque and odd elements are transparent. so like, dash, gap, dash, gap, the whole little dance πderiveβ clone this brush but change one or more of its attributes by passing in a hashref of options:
my $new = $brush->derive({ attr => $newvalue });
and here's the tea: the docs say the returned font will be identical to the cloned one, save the attributes specified. yes, it says font. we're just reporting what the manpage says, no cap. π«Ά
equal_to ($other)β returns1if this brush is equal to the supplied one, else returns0. a true/false moment. βοΈline_capβ set/get theline_capof this stroke. valid values arebutt,roundandsquare. pick your ending, bestie. πline_joinβ set/get theline_joinof this stroke. valid values aremiter,roundandbevel. pick your corner. β¨not_equal_to ($other)β opposite ofequal_to. the hater of the group. πwidthβ set/get the width of this stroke. defaults to1. skinny legend. π
π AUTHOR π
Cory Watson, "<gphat@cpan.org>" π
π COPYRIGHT & LICENSE π
Copyright 2008-2010 by Cory G Watson.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π§
okay so real talk: everything above is exactly what the page says, i just said it with my whole chest. don't come for me about 'butt', i didn't name it. π
and that's the page, babes β perl v5.34.0, dated 2022-06-14, served up fresh from User Contributed Perl Documentation. slay, stay strokey, and may all your caps be round πβ¨π
π¦ 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