al_color_rgb_to_hsl(3alleg5)

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

✨ al_color_rgb_to_hsl β€” Allegro 5 API ✨

okay bestie, pull up a chair πŸͺ‘ because we're about to talk about the glow-up of color formats. this is al_color_rgb_to_hsl(3alleg5) from the Allegro 5 API, and she's here to convert your RGB vibes into HSL realness. no cap. πŸ’…


🌈 SYNOPSIS

#include <allegro5/allegro_color.h>

void al_color_rgb_to_hsl(float red, float green, float blue,
   float *hue, float *saturation, float *lightness)

πŸ’– DESCRIPTION

so here's the tea, bestie πŸ“ β€” you hand over an RGB triplet, and every component lives in the range 0..1, okay? that's the rule, we don't break it.

then this function does its lil magic and gives you back:

  • the hue in degrees, chillin' somewhere between 0..360 πŸŽ€
  • the saturation in the range 0..1
  • the lightness in the range 0..1

and that's it. that's the whole serve. she ate and left no crumbs. πŸ‘‘

ngl, this one is a pointer party β€” hue, saturation and lightness are all float *, so you're passing in addresses to write the results into. bring your &s, bestie. 😭

πŸ‘€ SEE ALSO


and that's the whole page, periodt. ✨ this lil love letter lives in the Allegro reference manual, and yes, al_color_rgb_to_hsl(3alleg5) is exactly who she is. go convert some colors, main character. 🌸🫢

πŸ“¦ where this page comes from