PetscDrawRealToColor#

Maps a real value within an interval to a color. The color is an integer value in the range [PETSC_DRAW_BASIC_COLORS to 255] that can be passed to various drawing routines.

Synopsis#

#include <petscdraw.h>
int PetscDrawRealToColor(PetscReal value,PetscReal min,PetscReal max)

Not Collective

Input Parameters#

  • value - value to map within the interval [min, max]

  • min - lower end of interval

  • max - upper end of interval

Returns#

The result as integer

Note#

Values outside the interval [min, max] are clipped.

See Also#

PetscDraw, PetscDrawPointPixel(), PetscDrawPoint(), PetscDrawLine(), PetscDrawTriangle(), PetscDrawRectangle()

Level#

intermediate

Location#

include/petscdraw.h


Edit on GitLab

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages