Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / wsutil / color.h
blob794ba054205fa9cc7e3c0242064c3cfee1e458af
1 /** @file
3 * Definitions for colors
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
11 #ifndef __COLOR_H__
12 #define __COLOR_H__
14 #ifdef __cplusplus
15 extern "C" {
16 #endif /* __cplusplus */
18 #include <inttypes.h>
21 * Data structure holding RGB value for a color, 16 bits per channel.
23 typedef struct {
24 uint16_t red;
25 uint16_t green;
26 uint16_t blue;
27 } color_t;
30 * Convert a color_t to a 24-bit RGB value, reducing each channel to
31 * 8 bits and combining them.
33 inline static unsigned int
34 color_t_to_rgb(const color_t *color) {
35 return (((color->red >> 8) << 16)
36 | ((color->green >> 8) << 8)
37 | (color->blue >> 8));
40 #ifdef __cplusplus
42 #endif /* __cplusplus */
44 #endif
47 * Editor modelines - https://www.wireshark.org/tools/modelines.html
49 * Local variables:
50 * c-basic-offset: 4
51 * tab-width: 8
52 * indent-tabs-mode: nil
53 * End:
55 * vi: set shiftwidth=4 tabstop=8 expandtab:
56 * :indentSize=4:tabSize=8:noTabs=true: