RGBHSV(3NCARG)

πŸ’– RGBHSV β€” the NCAR Graphics glow-up page πŸ’–

okay bestie, welcome to the NCAR GRAPHICS manual, 3NCARG edition, and today we're doing color math πŸ’…

✨ NAME ✨

RGBHSV β€” converts a color spec that's living in the Red, Green, Blue (RGB) color space into color values over in the Hue, Saturation, and Value (HSV) color space. it's giving translator, it's giving bilingual icon 🌈


🫢 SYNOPSIS 🫢

CALL RGBHSV (R, G, B, H, S, V)

πŸŽ€ C-BINDING SYNOPSIS πŸŽ€

#include <ncarg/ncargC.h>

void c_rgbhsv (float r, float g, float b, float *h,
float *s, float *v)

🌸 DESCRIPTION 🌸

so here's the whole cast, no skips, everyone matters:

  • R β€” (REAL, input, range [0.,1.]) this is the red intensity component of your input point, in RGB color space. πŸ”΄
  • G β€” (REAL, input, range [0.,1.]) the green intensity component of the input point in RGB color space. πŸ’š
  • B β€” (REAL, input, range [0.,1.]) the blue intensity component of the input point in RGB color space. πŸ’™
  • H β€” (REAL, output, range [0.,360.)) the hue of the input point in HSV color space. heads up: a value of (R,0.,0.) in the input space will give you a hue of 0. in the output space. so pure red walks in, hue-zero walks out, that's the deal πŸ”₯
  • S β€” (REAL, output, range [0.,1.]) the saturation value of the input point in HSV color space. saturation is literally a measure of how much white light is mixed into the color, iykyk.
    • saturation values of 0. represent grays β€” and the gray value equals V.
    • saturation values of 1. are fully saturated colors.
    • the hue is technically undefined when S=0. β€” the code leaves H at its previous value when S=0. (0. initially). not me warning you about the undefined hue 😭
    • the fully saturated pure hues occur when S=1. and V=1. πŸ’…
  • V β€” (REAL, output, range [0.,1.]) the value in HSV space. that's it, that's the vibe check πŸ‘‘

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

the C-binding argument descriptions are the same as the FORTRAN argument descriptions. same energy, different language, no cap 🫢


⭐ EXAMPLES ⭐

use the ncargex command to see these relevant examples: tcolcv, fcce02. go look, they ate πŸ’–

πŸ¦‹ ACCESS πŸ¦‹

to use RGBHSV or c_rgbhsv, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c β€” preferably in that order. order matters bestie, don't be chaotic πŸ™ˆ

πŸ“ MESSAGES πŸ“

see the colconv man page for a description of all Colconv error messages and/or informational messages. everything's documented over there, periodt ✨

🌈 SEE ALSO 🌈

Online: colconv, hlsrgb, hsvrgb, rgbhls, 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.


and that's the whole page, bestie! source and version: this is the UNIX flavor of the manual, dated March 1993, filed under RGBHSV(3NCARG). iconic, historic, lowkey timeless πŸ’–βœ¨πŸŽ€