Graphi...:Brush(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

πŸ’… 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 new Graphics::Primitive::Brush. defaults to a width of 1, a line_cap of 'butt' and a line_join of '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) β€” returns 1 if this brush is equal to the supplied one, else returns 0. a true/false moment. βš–οΈ
  • line_cap β€” set/get the line_cap of this stroke. valid values are butt, round and square. pick your ending, bestie. 🌈
  • line_join β€” set/get the line_join of this stroke. valid values are miter, round and bevel. pick your corner. ✨
  • not_equal_to ($other) β€” opposite of equal_to. the hater of the group. πŸ’€
  • width β€” set/get the width of this stroke. defaults to 1. skinny legend. πŸ“

πŸ‘‘ AUTHOR πŸ‘‘

Cory Watson, "<gphat@cpan.org>" πŸ’Œ


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