# 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



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




## See Also
 `PetscDrawPointPixel()`, `PetscDrawPoint()`, `PetscDrawLine()`, `PetscDrawTriangle()`, `PetscDrawRectangle()`


## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscdraw.h.html#PetscDrawRealToColor">include/petscdraw.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscdraw.h)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
