1hsv_to_rgb(3)                   Allegro manual                   hsv_to_rgb(3)
2
3
4

NAME

6       hsv_to_rgb,  rgb_to_hsv - Converts color values between the HSV and RGB
7       color spaces. Allegro game programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       void hsv_to_rgb(float h, float s, float v, int *r, int *g, int *b);
14
15       void rgb_to_hsv(int r, int g, int b, float *h, float *s, float *v);
16

DESCRIPTION

18       Convert color values between the HSV and RGB color spaces. The RGB val‐
19       ues range from 0 to 255, hue is from 0 to 360, and saturation and value
20       are from 0 to 1. Example:
21
22          int r, g, b;
23          float hue, saturation, value;
24          ...
25          /* Convert a reddish color to HSV format. */
26          rgb_to_hsv(255, 0, 128, &hue, &saturation, &value);
27
28          /* Now put our tin foil hat, and verify that. */
29          hsv_to_rgb(hue, saturation, value, &r, &g, &b);
30          ASSERT(r == 255);
31          ASSERT(g == 0);
32          ASSERT(b == 128);
33
34
35
36

SEE ALSO

38       exlights(3), exrgbhsv(3)
39
40
41
42Allegro                          version 4.4.2                   hsv_to_rgb(3)
Impressum