Color:...::Color(3pm)

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

✨ NAME ✨

Color::Library::Color β€” it's literally a single color entry for a Color::Library color dictionary πŸ’– the lil main character of one (1) swatch, no cap


πŸŽ€ METHODS πŸŽ€

  • $id = $color->id β€” hands you back the id of the color 🫢

An id is formatted like <dictionary_id:color_name>, bestie. For example:

svg:aliceblue
x11:bisque2
nbs-iscc-f:chromeyellow.66
vaccc:darkspringyellow
  • $name = $color->name β€” gives you the name of the color, like:
aliceblue
bisque2
chromeyellow
darkspringyellow
  • $title = $color->title β€” gives you the title</title> of the color, like:
aliceblue
bisque2
chrome yellow
Dark Spring-Yellow
  • $dictionary = $color->dictionary β€” returns the Color::Library::Dictionary object that this color belongs to πŸ¦‹ (yes, every color knows its home dictionary, iconic)
  • $hex = $color->hex β€” returns the hex value of the color, like:
ff08ff
eed5b7
eaa221
669900
Heads up bestie: $hex does NOT include the leading #. If you want that lil hash, use $color->html, $color->css, or $color->svg πŸ’…
  • $html = $color->html
  • $css = $color->css
  • $svg = $color->svg β€” these three return the hex value of the color with a leading #, so it's ready to drop straight into HTML, CSS, or SVG documents. Example time:
#ff08ff
#eed5b7
#eaa221
#669900
  • $value = $color->value β€” returns the numeric value of the color, like:
15792383
15652279
15376929
6723840
  • ($r, $g, $b) = $color->rgb β€” in list context, returns the r, g, and b values of the color as a 3 element list πŸ“ like:
(240, 248, 255)
  • $rgb = $color->rgb β€” in scalar context, returns r, g, and b as a 3 element array, like:
[ 240, 248, 255 ]
  • $color = Color::Library::Color->new( id => $id, name => $name, title => $title, value => $value )
  • $color = Color::Library::Color->new( { id => $id, name => $name, title => $title, value => $value } )
  • $color = Color::Library::Color->new( [[ $id, $name, $title, $rgb, $hex, $value ]] ) β€” returns a fresh new Color::Library::Color object representing the color you specified ✨
Ngl, you probably don't want or need to call this yourself πŸ™ˆ

🧚 FUNCTIONS 🧚

  • $hex = Color::Library::Color::rgb2hex( $rgb )
  • $hex = Color::Library::Color::rgb2hex( $r, $g, $b ) β€” converts an rgb value into its hex representation πŸ’…
  • $value = Color::Library::Color::rgb2value( $rgb )
  • $value = Color::Library::Color::rgb2value( $r, $g, $b ) β€” converts an rgb value into its numeric representation
  • $rgb = Color::Library::Color::value2rgb( $value )
  • ($r, $g, $b) = Color::Library::Color::value2rgb( $value ) β€” converts a numeric color value into its rgb representation 🌈
  • ($r, $g, $b) = Color::Library::Color::parse_rgb_color( $hex )
  • ($r, $g, $b) = Color::Library::Color::parse_rgb_color( $value ) β€” makes a best effort to convert a hex or numeric color value into its rgb representation πŸ‘‘

okay that's the whole page, you ate it, periodt πŸ’œ

Cute lil sign-off: this one's from perl v5.36.0, dated 2022-11-27 πŸŽ€ bye bestie, go paint something pretty 🌸

πŸ“¦ where this page comes from