Colconv(3NCARG)

πŸ“¦ version 6.6.2, in epel 9, fedora 43, fedora 44

πŸ’– Colconv β€” the NCAR GRAPHICS color-model glow-up πŸ’–

okay bestie, welcome to Colconv (that's Colconv(3NCARG), the NCAR GRAPHICS one). this is the routine that lets you convert a color spec between the color models RGB, HSV, HLS, and YIQ. that's literally it, that's the whole vibe. she converts. she slays. periodt. πŸ’…


✨ NAME ✨

Colconv β€” Allows a user to convert among the color models RGB, HSV, HLS, and YIQ. πŸŽ¨πŸ¦‹


🌸 SYNOPSIS 🌸

okay so there's a whole lil squad here, one function per conversion. no cap, they all do exactly what their name says:

  • HLSRGB β€” Converts a color specification given as Hue, Lightness, and Saturation (HLS) values to Red, Green, and Blue (RGB) intensity values in the RGB color space.
  • HSVRGB β€” Converts a color specification given in the Hue, Saturation, and Value (HSV) color space to color values in the Red, Green, Blue (RGB) color space.
  • RGBHLS β€” Converts a color specification given in the Red, Green, Blue (RGB) color space to color values in the Hue, Lightness, Saturation (HLS) color space.
  • RGBHSV β€” Converts a color specification given in the Red, Green, Blue (RGB) color space to color values in the Hue, Saturation, and Value (HSV) color space.
  • RGBYIQ β€” Converts a color specification given in the RGB Red, Green, Blue, (RGB) color space to a color specification in the YIQ color space.
  • YIQRGB β€” Converts a color specification given in the YIQ color space to the equivalent color specification in the Red, Green, Blue (RGB) color space.

it's giving "one job, done flawlessly." πŸ‘‘


🌈 C-BINDING SYNOPSIS 🌈

for my C girls, you get lowercase lil versions of everybody. first, obviously:

#include <ncarg/ncargC.h>

and then the cast, in order:

c_hlsrgb
c_hsvrgb
c_rgbhls
c_rgbhsv
c_rgbyiq
c_yiqrgb
πŸ’€ yes bestie, c_hlsrgb goes from HLS to RGB even though the letters read the other way. that's just how she is. we don't question the icon.

πŸŽ€ ACCESS πŸŽ€

To use Colconv or the c_colconv routines, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β€” preferably in that order. (the order matters, don't be chaotic about it, i'm begging πŸ™ˆ)


🚨 MESSAGES 🚨

When error conditions are detected, the support routine SETER is called in such a way that it writes a message to the standard error file (as defined by I1MACH(4)) and then terminates execution. like, that's it, that's the end of the run. no gentle warning arc. 😭

so here's the full list of possible error messages, and what each one means:

  • HLSRGB - L out of range β€” Lightness is less than 0. or greater than 100.
  • HLSRGB - S out of range β€” Saturation is less than 0. or greater than 100.
  • HSVRGB - S out of range β€” Saturation is less than 0. or greater than 1.
  • HSVRGB - V out of range β€” Value of input color is less than 0. or greater than 1.
  • RGBHLS - R out of range β€” Value of red intensity component is less than 0. or greater than 1.
  • RGBHLS - G out of range β€” Value of green intensity component is less than 0. or greater than 1.
  • RGBHLS - B out of range β€” Value of blue intensity component is less than 0. or greater than 1.
  • RGBHSV - R out of range β€” Value of red intensity component is less than 0. or greater than 1.
  • RGBHSV - G out of range β€” Value of green intensity component is less than 0. or greater than 1.
  • RGBHSV - B out of range β€” Value of blue intensity component is less than 0. or greater than 1.
⚠️ bestie. check your ranges. i'm not even being dramatic, SETER will literally end your whole program over a 1.5. vibe check your inputs before you hand them over. 🫢

πŸ‘€ SEE ALSO πŸ‘€

  • Online: hlsrgb, hsvrgb, rgbhls, rgbhsv, rgbyiq, yiqrgb, ncarg_cbind.
  • Hardcopy: NCAR Graphics Fundamentals, UNIX Version

go read the friends, they're all in the same friend group. iykyk. πŸ’œ


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


that's the whole page bestie, you ate it, every last flag and range and legal line intact, no crumbs left. πŸ“βœ¨

kisses from the UNIX manual page, dated March 1993, titled Colconv(3NCARG) β€” mwah πŸ’‹

πŸ“¦ where this page comes from