5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include "color_utils.h"
29 * Initialize a color with R, G, and B values, including any toolkit-dependent
30 * work that needs to be done.
33 initialize_color(color_t
*color
, guint16 red
, guint16 green
, guint16 blue
)
37 // color_t uses 16-bit components to match Gtk+. Qt use 8.
38 qc
.setRgb(red
>>8, green
>>8, blue
>>8);
42 // Match what color_filters.c does.
50 ColorUtils::ColorUtils(QObject
*parent
) :
55 QColor
ColorUtils::fromColorT (color_t
*color
) {
56 if (!color
) return QColor();
57 return QColor(color
->red
>> 8, color
->green
>> 8, color
->blue
>> 8);
60 QColor
ColorUtils::fromColorT(color_t color
)
62 return fromColorT(&color
);
71 * indent-tabs-mode: nil
74 * ex: set shiftwidth=4 tabstop=8 expandtab:
75 * :indentSize=4:tabSize=8:noTabs=true: