Color:...ionary(3pm)

πŸ“¦
version 0.021 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ’– NAME πŸ’–

Color::Library::Dictionary β€” bestie, this is the color dictionary for Color::Library. That's it, that's the whole vibe. πŸŽ€


✨ METHODS ✨

So like, here's everything your dictionary object can do for you. Slay. πŸ’…

πŸ¦‹ @colors = $dictionary->colors

Gives you back the list of Color::Library::Color objects that $dictionary is holding. All of them. The whole squad. πŸ‘‘

Heads up tho β€” context matters, no cap: you get a list in list context, and a list reference in scalar context. Same deal, different wrapper. 🫢

🌸 @names = $dictionary->names

🌸 @names = $dictionary->color_names

Returns the list of color names contained by $dictionary. Two method names, same energy, pick whichever one feels right for your soul. ✨

And yes, same context rules: list in list context, list reference in scalar context. Periodt.

πŸ’œ $color = $dictionary->color( <query> )

Returns a Color::Library::Color object of $dictionary found via <query>. It's giving "search bar but make it fancy". πŸ”

And a query can be any of the following:

  • color name β€” a color name is like "blue" or "bleached-almond" πŸ“
  • color title β€” a color title is like "Dark Green-Teal" 🌈
  • color id β€” a color id is in the form of <dictionary_id>:<color_name>, for example: "x11:azure1" πŸ’€

🧚 $id = $dictionary->id

🧚 $name = $dictionary->name

Returns the id (name) of $dictionary, e.g.

svg
x11
vaccc
nbs-iscc-f

πŸ‘‘ $title = $dictionary->title

Returns the title of $dictionary, e.g.

SVG
X11
VACCC
NBS/ISCC F

🌈 $subtitle = $dictionary->subtitle

Returns the subtitle of $dictionary, if any. If there isn't one… well, it's giving nothing. And that's fine. πŸ™ˆ

πŸ’« $description = $dictionary->description

Returns the description of $dictionary, if any. Same deal as the subtitle β€” only if it exists, bestie. 😭


ngl the fact that you read the whole page? main character energy fr fr. 🫢

okay bye ily, this was perl v5.36.0 from 2022-11-27, User Contributed Perl Documentation, xoxo πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from