al_color_name_to_rgb(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸ’… al_color_name_to_rgb(3) πŸ’…

okay so bestie, this page comes from the Library Functions Manual, and the main character is al_color_name_to_rgb(3). It’s Allegro 5 API, and it’s literally here to turn a color name into RGB. slay.


🌸 NAME 🌸

al_color_name_to_rgb β€” Allegro 5 API

✨ SYNOPSIS ✨

#include <allegro5/allegro_color.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

Lowkey the whole vibe: you hand it a color name, and it gives you back RGB values. Here’s the tea, bestie.

🫢 Parameters 🫢

  • name β€” The (lowercase) name of the color.
  • r, g, b β€” If one of the recognized color names below is passed, the corresponding RGB values in the range 0..1 are written.

The 148 recognized names are, fr fr:

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/

Note that these 9 colors have two names and 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.

πŸ”₯ SEE ALSO πŸ”₯


β€” from the Allegro reference manual, no date listed on this page, signing off for al_color_name_to_rgb(3) πŸ’–πŸ’…

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms