GSET_COLR_REP(3NCARG)
β¨ GSET_COLR_REP β¨
okay bestie, welcome to the NCAR GRAPHICS corner of the manual, where we're talking about gset_colr_rep π¨ (aka Set color representation) β the function that associates a color value with a color index. that's it, that's the whole vibe. let's get into it π
πΈ SYNOPSIS πΈ
#include <ncarg/gks.h>
void gset_colr_rep(Gint ws_id, Gint colr_ind, const Gcolr_rep *colr_rep);
π DESCRIPTION π
here's what you're feeding it, bestie:
ws_idβ (Input) a workstation identifier. and no, you can't just make one up, it has to be the same one you used in some previousgopen_wscall. consistency is the moment. β¨colr_indβ (Input) a color index. which slot in the color table are we redecorating today? πcolr_rep.rgb.redβ (Gfloat, Input) the intensity value for red, and it lives between0.and1.inclusive. no going outside that range, iykyk. β€οΈcolr_rep.rgb.greenβ (Gfloat, Input) the intensity value for green, also between0.and1.inclusive. πcolr_rep.rgb.blueβ (Gfloat, Input) the intensity value for blue, between0.and1.inclusive. π
three lil floats walk into a struct and now you have a color. iconic behavior fr fr.
π¦ USAGE π¦
so in GKS, color is "indexed" β meaning color attributes get assigned to primitives by using a color index. the GKS function gset_colr_rep is the one you use to associate a color value with those color indices. that's its whole job and it does it well. π
recommendation time, bestie, listen up: it's 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 you not call gset_colr_rep to change a color value after the original definitions. define it once, define it right, periodt. π
gset_colr_rep may be called after opening the workstation for which the color indices are to be defined β and not before that workstation is opened. don't come at it early, it's not ready. π
and the way that different workstations can keep different color tables?? obsessed. 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. same index, different eras. main character energy for real. β¨
big important one, do not skip this: 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 then nothing shows up and you're sitting there like π. so. define index 0. pls.
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 got 256 slots, bestie, go decorate. π
π ACCESS π
to use the GKS C-binding routines, you gotta load the ncarg_gks and ncarg_c libraries. no libraries, no vibes. π«Ά
β SEE ALSO β
Online:
ginq_colr_rep(3NCARG)gset_line_colr_ind(3NCARG)gset_marker_colr_ind(3NCARG)gset_fill_colr_ind(3NCARG)gset_text_colr_ind(3NCARG)ginq_line_colr_ind(3NCARG)ginq_marker_colr_ind(3NCARG)ginq_fill_colr_ind(3NCARG)ginq_text_colr_ind(3NCARG)gks(3NCARG)ncarg_gks_cbind(3NCARG)
Hardcopy:
- User's Guide for NCAR GKS-0A Graphics
- NCAR Graphics Fundamentals, UNIX Version
π COPYRIGHT π
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 lil gem comes from the UNIX manual, March 1993 edition, filed under GSET_COLR_REP(3NCARG). go forth and set those color representations, you absolute icon π¦β¨
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms