Types
Scale = enum sGray = "gray", ## Grey scale black -> white sHue = "hue", ## Ancient HSV system "everyone" knows sWLen = "wLen", ## Close to a physical spectrum/rainbow sPm3D = "pm3d", ## Popularized by OS/2PresMgr | Gnuplot sViridis = "viridis" ## Very popular, maps well to gray outs
UnitR = range[0.0 .. 1.0]
Consts
helpColorScl = "{fbu}sNAME<0.-1>[,..]: element of NAME: viridis hue[,s,v] wLen[,s,v] gray pm3d"
Procs
proc parseColorScl(s: MSlice | openArray[char] | string; nParsed: var int = doNotUse): Color3
- Parse color scale like <sclNmPfx>FLOAT[,..] where <sclNmPfx> is the first letter of a scale name, FLOAT is 0..1 scale, & [,..] are optional params. nParse gets number of chars handled. An eg. good spec is: "w.3,.7,.65" for 30% wLen at 70% saturation, 65% value. { Yes, this could be fancier. }
proc scaledCompon(x: float; lim: range[4 .. 1024] = 256): int {....raises: [], tags: [], forbids: [].}