TDCLRS(3NCARG)

✨ TDCLRS ✨

okay bestie, welcome to TDCLRS from the NCAR Graphics crew (that's the 3NCARG manual, if you were wondering) πŸ’– this little icon does GKS calls to define colors for TDPACK. yes, the TDPACK. we're color-coordinating, we're slaying, we're making surfaces look cute. periodt.


πŸ“œ SYNOPSIS

CALL TDCLRS (IWID, IBOW, SHDE, SHDR, IOFC, IOLC, ILMT)

πŸŽ€ C-BINDING SYNOPSIS

#include <ncarg/ncargC.h>

void c_tdclrs(int iwid, int ibow, float shde, float shdr, int iofc, int
iolc, int ilmt)

🌈 DESCRIPTION

so this routine gets called to do the GKS calls that define the following colors on a specified workstation. heads up: NSHD is equal to IOLC-IOFC+1, aka the number of elements in each block of color shades. write that down πŸ“

  • Color 0 = background color (depends on IBOW)
  • Color 1 = foreground color (depends on IBOW)
  • Color 2 = red (RGB values 1,0,0)
  • Color 3 = green (RGB values 0,1,0)
  • Color 4 = blue (RGB values 0,0,1)
  • Color 5 = cyan (RGB values 0,1,1)
  • Color 6 = magenta (RGB values 1,0,1)
  • Color 7 = yellow (RGB values 1,1,0)
  • Colors IOFC - IOLC = grays, white to black
  • Colors IOFC+NSHD - IOLC+NSHD = grays
  • Colors IOFC+2*NSHD - IOLC+2*NSHD = reds
  • Colors IOFC+3*NSHD - IOLC+3*NSHD = greens
  • Colors IOFC+4*NSHD - IOLC+4*NSHD = blues
  • Colors IOFC+5*NSHD - IOLC+5*NSHD = cyans
  • Colors IOFC+6*NSHD - IOLC+6*NSHD = magentas
  • Colors IOFC+7*NSHD - IOLC+7*NSHD = yellows

the colors you define by calling TDCLRS? you can use them for literally anything, but they're especially iconic when you're calling TDPACK routines to render surfaces. it's giving main character energy πŸ¦‹

the arguments of TDCLRS are, like, as follows:

  • IWID β€” (an input expression of type INTEGER) the workstation identifier. it's the ID, bestie, the vibe check for which workstation you're talking to.
  • IBOW β€” (an input expression of type INTEGER) a flag specifying the basic color scheme (white on black or black on white). if IBOW is 0, the foreground color is white and the background color is black; if IBOW is non-zero, the opposite is true. flip the whole aesthetic, why not πŸ’…
  • SHDE and SHDR β€” (input expressions of type REAL) each of these values is between 0 and 1, inclusive, specifying how color shades are to be generated. values of SHDE near 0 call for more intense shades to be used, while values near 1 call for more nearly pastel shades to be used. values of SHDR near 0 say that a narrower range of shades is to be used, while values near 1 say that a broader range of shades is to be used. so like… 0 = loud and narrow, 1 = soft and expansive. we contain multitudes 🌸
  • IOFC and IOLC β€” (input expressions of type INTEGER) these specify the first and last integers in a block of color indices to be used for NSHD shades of gray ranging from pure white to pure black (where NSHD=IOLC-IOFC+1). the next NSHD indices (in numerical order) will be used for the shades of gray selected by SHDE and SHDR; the next NSHD indices after that for selected shades of red, the next NSHD indices after that for selected shades of green, and so on. it's a whole conga line of color indices πŸŽ€
  • ILMT β€” (an input expression of type INTEGER) using a value between 1 and 7, inclusive, says that only that many blocks of NSHD indices will be defined. for example, if ILMT has the value 4, only the black-to-white scale and the shades of gray, red, and green will be generated; shades of blue, cyan, magenta, and yellow will not be. (this allows one to have more shades of each color at the expense of using fewer colors.) using a value of ILMT less than 1 or greater than 7 will result in all 8*NSHD sets of color shades being defined. so you either limit it on purpose or you get the whole entire rainbow, no in-between 🌈

🫢 C-BINDING DESCRIPTION

the C-binding argument descriptions are the same as the FORTRAN argument descriptions. same energy, different syntax, iykyk πŸ’œ


πŸ”‘ ACCESS

to use TDCLRS or c_tdclrs, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. don't scramble the order, bestie, that's not the vibe πŸ™ˆ


πŸ‘€ SEE ALSO

Online: tdctri, tddtri, tdgeti, tdgetr, tdgrds, tdgrid, tdgtrs, tdinit, tditri, tdlbla, tdlbls, tdline, tdlnpa, tdmtri, tdotri, tdpack, tdpack_params, tdpara, tdplch, tdprpa, tdprpi, tdprpt, tdseti, tdsetr, tdsort, tdstri, tdstrs

(the whole friend group, fr fr πŸ«‚)


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

not me reminding you to actually read the license agreement 😭 it's giving responsible queen behavior πŸ‘‘

okay that's the whole page, no cap. this was TDCLRS(3NCARG) from the NCAR GRAPHICS manual, UNIX edition, dated July 1997 β€” old enough to be vintage but still absolutely serving βœ¨πŸ¦‹πŸ’– slay responsibly, bestie 🌸