al_color_name_to_rgb(3)
π
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 range0..1are 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