GSCR(3NCARG)

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

πŸ’– GSCR β€” set color representation, bestie edition πŸ’–

okay so this is GSCR from the NCAR Graphics manual, section 3NCARG. And the vibe? It associates a color value with a color index. That's the whole thing. She's a little function with a big job: she's the one who decides that index 2 means "red" for you. Iconic behavior honestly. 🎨✨


✨ SYNOPSIS ✨

CALL GSCR (WKID, CI, CR, CG, CB)

🌈 C-BINDING SYNOPSIS 🌈

#include <ncarg/gks.h>

void gset_colr_rep(Gint ws_id, Gint colr_ind, const Gcolr_rep *colr_rep);

πŸŽ€ DESCRIPTION πŸŽ€

here's the tea on every single argument, no skips, no cuts:

  • WKID (Integer, Input) β€” a workstation identifier. and listen, WKID has to be the same one you used in some previous GOPWK call. like, they have to match. that's the rule. πŸ‘‘
  • CI (Integer, Input) β€” a color index. this is the little number you're assigning a color to.
  • CR (Real, Input) β€” an intensity value for red, between 0. and 1. inclusive.
  • CG (Real, Input) β€” an intensity value for green, between 0. and 1. inclusive.
  • CB (Real, Input) β€” an intensity value for blue, between 0. and 1. inclusive.

so yeah, three floats between 0 and 1 walk into a bar and make a color. that's RGB, bestie, that's literally it. πŸ“πŸŒΈπŸ¦‹


πŸ’… USAGE πŸ’…

so color in GKS is "indexed", meaning color attributes get assigned to primitives by using a color index. and the GKS function GSCR is the one that associates a color value with color indices. she's the matchmaker. 🫢

it is recommended that all color indices used in a given job be defined prior to calling any output primitive. and since the result of a dynamic color change can be ambiguous, it's also recommended that GSCR not be called to change a color value after the original definitions. like, define it once, then leave her alone, she's already decided. 😭

GSCR may be called after opening the workstation for which the color indices are to be defined, and not before that workstation is opened. read that again. not before. 🚫

different color tables can be maintained for different workstations. for example, color index 2 for a CGM file may be associated with "red" while at the same time it may be associated with "green" for some X workstation. the range, the versatility, the range. πŸ’€

it is important to stress that color index 0 defines the background color. if any color indices are defined, then you should define the background color index 0. otherwise you run the risk of having a user-defined color match the default background color. and that's the kind of bug that makes you stare at your screen like πŸ™ˆ so just define index 0, okay?

for all GKS output primitives, color is assigned by an indexing scheme. the indices run from 0 to 255, where 0 is the background color index and 1 is the foreground color index. so you've got 256 slots and slot 0 and slot 1 are already spoken for. periodt. πŸ‘‘


πŸ”₯ ACCESS πŸ”₯

to use GKS routines, load the NCAR GKS-0A library ncarg_gks. that's the whole assignment. go get her. 🧚


🌟 SEE ALSO 🌟

Online: gqcr, gsplci, gspmci, gsfaci, gstxci, gqplci, gqpmci, gqfaci, gqtxci, gset_colr_rep

Hardcopy: User's Guide for NCAR GKS-0A Graphics; 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 πŸ’– this one dropped on UNIX back in March 1993 β€” yes she's vintage, yes she still ate, no cap. go define your colors and slay πŸŒˆβ­πŸ’œ

πŸ“¦ where this page comes from