HLSRGB(3NCARG)

✨ HLSRGB β€” it's giving color conversion, bestie ✨

okay so real talk, this is a page from the NCAR GRAPHICS manual, section 3NCARG, and it's about a little routine called HLSRGB πŸ’–


πŸŽ€ NAME πŸŽ€

HLSRGB β€” converts a color specification given as Hue, Lightness, and Saturation (HLS) values to Red, Green, and Blue (RGB) intensity values. it's literally the glow-up pipeline for your colors, no cap 🌈


🌸 SYNOPSIS 🌸

CALL HLSRGB ( H, L, S, R, G, B )

that's it. that's the whole vibe. six little args and you're done πŸ’…


πŸ¦‹ C-BINDING SYNOPSIS πŸ¦‹

for my C girlies (iykyk):

#include <ncarg/ncargC.h>

void c_hlsrgb (float h, float l, float s, float *r,
float *g, float *b)

✨ DESCRIPTION ✨

so here's the tea on every single argument, and yes i'm giving you all of them because you deserve the full picture 🫢

  • H β€” (REAL, input, range [0.,360.)) this is the hue of your input color in HLS color space. and listen, H=0. corresponds to blue. not red, not pink, blue. iconic of it honestly πŸ’™
  • L β€” (REAL, input, range [0.,100.]) the lightness value of your input color in HLS color space. lightness is a measure of the quantity of light β€” a lightness of 0. is black, and a lightness of 100. gives white. the pure hues occur at lightness value 50. so 50 is the main character here, periodt ✨
  • S β€” (REAL, input, range [0.,100.]) the saturation value of your input color in HLS color space. saturation is a measure of how much white light is mixed with the color. colors having a saturation value of 0. represent grays with a gray intensity value equal to the lightness L. colors with a saturation value of 100. are fully saturated colors. also important: the hue is undefined when S=0. 😭 so don't come for H when there's no S. the fully saturated pure hues occur when S=100. and L=50.
  • R β€” (REAL, output, range [0.,1.]) the red intensity component of the output color in RGB color space πŸ”₯
  • G β€” (REAL, output, range [0.,1.]) the green intensity component of the output color in RGB color space 🌿
  • B β€” (REAL, output, range [0.,1.]) the blue intensity component of the output color in RGB color space πŸ’™

πŸ’œ C-BINDING DESCRIPTION πŸ’œ

good news bestie, nothing new to memorize here β€” the C-binding argument descriptions are the same as the FORTRAN argument descriptions. same facts, different syntax, we love a consistent queen πŸ‘‘


πŸ“ EXAMPLES πŸ“

want to see this in the wild? use the ncargex command to see the following relevant examples: ccpcldm, ccplbam, ccpllb, ccplll, ccpllw, colcon, fcce02. go look, it's giving research era πŸ”


🌈 ACCESS 🌈

to use HLSRGB or c_hlsrgb, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. order matters, don't be chaotic about it πŸ’…


πŸ’€ MESSAGES πŸ’€

see the colconv man page for a description of all Colconv error messages and/or informational messages. yes, there's a whole other page for the drama, go read it 🫢


⭐ SEE ALSO ⭐

Online: colconv, hlsrgb, hsvrgb, rgbhls, rgbhsv, rgbyiq, yiqrgb, ncarg_cbind.

Hardcopy: NCAR Graphics Fundamentals, UNIX Version


Copyright (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.


ok that's the whole page, go convert some colors, you absolute legend 🌸

mwah πŸ’‹ this was the UNIX release from March 1993, HLSRGB(3NCARG), signing off β€” stay saturated, stay iconic ✨