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