fabien van mook

all packages "fvm-*"

package "fvm-colourgrade"

function file "colourgrade_bluered.m"

Function cg = colourgrade_bluered(cg)
         cg = colourgrade_bluered(cg,n,reverse)
         cg = colourgrade_bluered(cg,[],reverse)

returns struct cg with information 
on the colourmap produced by m-file 
bluered.m. The colourmap is extended
by three colours (green/gray) to 
indicate infra, ultra and na/nan
values.

The colourmap may be practical for 
showing negative and positive values.

All input arguments are optional; an
empty matrix [] indicates "no input
for that argument".

If the struct cg contains the fields
  cg.gradevalues 
  cg.tickvalues and/or
  cg.ticktexts 
and/or 
  cg.offset
at input, this information will be 
used to produce the colourmap. However,
if input argument n is provided, the
first three fields will be (re)defined
based on the number of grades n.

If neither information from cg at input
can be obtained, nor input argument n
is given, defaults will be set for the 
above mentioned fields.

At input, the struct cg may have the following 
optional fields:
  cg.gradevalues (column vector of reals)
  cg.gradeticks  (column vector of booleans)
  cg.gradetexts  (column cell-array of strings)
  cg.offset      (cg.icm_min + cg.offset is the
                  row index to the colourmap
                  where the second part starts)

At output, the struc cg contains new or renewed fields:
  cg.offset      (cg.icm_min + cg.offset is the
                  row index to the colourmap
                  where the second part starts)
  cg.colourmap (colourmap, a n*3 matrix)
  cg.icm_infra (row index to cg.colourmap)
  cg.icm_min   (row index to cg.colourmap)
  cg.icm_max   (row index to cg.colourmap)
  cg.icm_ultra (row index to cg.colourmap)
  cg.icm_nanan (row index to cg.colourmap)

The output struc cg contains also any 
other fields with defaults defined by
m-file colourgrade_init.m.

The function internally calls the following
non-standard m-files:
  bluered.m
  colourgrade_init.m
  colourgrade_init_ngrade.m


(c) 2026 fabien van mook

2026.08.20 release of this file within package "fvm-colourgrade" under GNU GPLv3+