GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
psdriver/color.c
Go to the documentation of this file.
1 #include <grass/gis.h>
2 #include "psdriver.h"
3 
4 void PS_Color(int r, int g, int b)
5 {
6  if (ps.true_color)
7  output("%d %d %d COLOR\n", r, g, b);
8  else
9  output("%d GRAY\n", (int)(r * 0.299 + g * 0.587 + b * 0.114));
10 }
float g
Definition: named_colr.c:7
void PS_Color(int r, int g, int b)
Definition: psdriver/color.c:4
struct ps_state ps
void output(const char *fmt,...)
double b
Definition: r_raster.c:39
double r
Definition: r_raster.c:39
int true_color
Definition: psdriver.h:14