al_color_name_to_rgb(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– al_color_name_to_rgb β€” Allegro 5 API πŸ’–

okay bestie, welcome to al_color_name_to_rgb(3alleg5), straight out of the Allegro 5 API. this one's a lil cutie: you hand it a color name, it hands you back actual numbers. let's get into it πŸŽ€


✨ SYNOPSIS ✨

#include <allegro5/allegro_color.h>

bool al_color_name_to_rgb(char const *name, float *r, float *g, float *b)

🌸 DESCRIPTION 🌸

here's the tea on the parameters, bestie:

  • name β€” the (lowercase) name of the color. lowercase only, she's picky πŸ’…
  • r, g, b β€” if you pass one of the recognized color names listed below, the corresponding RGB values in the range 0..1 get written in here. yes, 0..1, not 0..255, we're fancy like that ✨

the 148 recognized names are:

aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque,
black, blanchedalmond, blue, blueviolet, brown, burlywood,
cadetblue, chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan, darkgoldenrod,
darkgray, darkgreen, darkkhaki, darkmagenta, darkolivegreen,
darkorange, darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkturquoise, darkviolet,
deeppink, deepskyblue, dimgray, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro, ghostwhite,
goldenrod, gold, gray, green, greenyellow, honeydew, hotpink,
indianred, indigo, ivory, khaki, lavenderblush, lavender,
lawngreen, lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgreen, lightgrey, lightpink,
lightsalmon, lightseagreen, lightskyblue, lightslategray,
lightsteelblue, lightyellow, lime, limegreen, linen, magenta,
maroon, mediumaquamarine, mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue, mintcream,
mistyrose, moccasin, avajowhite, navy, oldlace, olive, olivedrab,
orange, orangered, orchid, palegoldenrod, palegreen,
paleturquoise, palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, rebeccapurple, red, rosybrown,
royalblue, saddlebrown, salmon, sandybrown, seagreen, seashell,
sienna, silver, skyblue, slateblue, slategray, snow, springgreen,
steelblue, tan, teal, thistle, tomato, turquoise, violet, wheat,
white, whitesmoke, yellow, yellowgreen

they are taken from CSS: https://www.w3.org/TR/css-color-4/ β€” no cap, that's the source 🫢

heads up babes: these 9 colors have two names each, so there are only 139 distinct colors: aqua = cyan, darkgray = darkgrey, darkslategray = darkslategrey, dimgray = dimgrey, fuchsia = purple, gray = grey, lightgray = lightgrey, lightslategray = lightslategrey, slategray = slategrey

Returns: true if a name from the list above was passed, else false. so like, vibe check: did your name make the list? yes β†’ true, no β†’ false πŸ’€


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, bestie πŸ’œ this came to you from the Allegro reference manual, page al_color_name_to_rgb(3alleg5), manual section 3alleg5 β€” go forth and name your colors, you ate πŸ¦‹βœ¨

πŸ“¦ where this page comes from