#include "common.h"#include <stdlib.h>#include <stdio.h>#include <math.h>#include <ctype.h>#include <strings.h>#include "machine.h"#include "bu.h"#include "vmath.h"Include dependency graph for color.c:

Go to the source code of this file.
Defines | |
| #define | ACHROMATIC -1.0 |
| #define | HUE 0 |
| #define | SAT 1 |
| #define | VAL 2 |
| #define | RED 0 |
| #define | GRN 1 |
| #define | BLU 2 |
Functions | |
| void | bu_rgb_to_hsv (unsigned char *rgb, fastf_t *hsv) |
| int | bu_hsv_to_rgb (fastf_t *hsv, unsigned char *rgb) |
| int | bu_str_to_rgb (char *str, unsigned char *rgb) |
R, G, and B are in {0, 1, ..., 255},
H is in [0.0, 360.0), and S and V are in [0.0, 1.0],
unless S = 0.0, in which case H = ACHROMATIC.
These two routines are adapted from: pp. 592-3 of J.D. Foley, A. van Dam, S.K. Feiner, and J.F. Hughes, _Computer graphics: principles and practice_, 2nd ed., Addison-Wesley, Reading, MA, 1990.
Definition in file color.c.
1.4.6