sq krb_pa_supported_enctypes
[metze/wireshark/wip.git] / wsutil / color.h
1 /* color.h
2  * Definitions for colors
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 #ifndef  __COLOR_H__
11 #define  __COLOR_H__
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif /* __cplusplus */
16
17 /*
18  * Data structure holding RGB value for a color, 16 bits per channel.
19  */
20 typedef struct {
21     guint16 red;
22     guint16 green;
23     guint16 blue;
24 } color_t;
25
26 /*
27  * Convert a color_t to a 24-bit RGB value, reducing each channel to
28  * 8 bits and combining them.
29  */
30 inline static unsigned int
31 color_t_to_rgb(const color_t *color) {
32     return (((color->red >> 8) << 16)
33           | ((color->green >> 8) << 8)
34           | (color->blue >> 8));
35 }
36
37 #ifdef __cplusplus
38 }
39 #endif /* __cplusplus */
40
41 #endif
42
43 /*
44  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
45  *
46  * Local variables:
47  * c-basic-offset: 4
48  * tab-width: 8
49  * indent-tabs-mode: nil
50  * End:
51  *
52  * vi: set shiftwidth=4 tabstop=8 expandtab:
53  * :indentSize=4:tabSize=8:noTabs=true:
54  */