GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
gui-utils.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1993-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_gui_utils_h)
27#define octave_gui_utils_h 1
28
29#include "octave-config.h"
30
31#include <QColor>
32
33namespace octave
34{
35
36 /*!
37 Deterimine an alternative color to @p col1 with less contrast
38 to @p col2. The HSV representation of the new color is calculated by
39 \f{eqnarray*}{
40 H &=& H_1\\
41 S &=& f_s S_1\\
42 V &=& V_1 + f_s (V_2 - V_1)
43 \f}
44
45 @param col1 Base color to which the alternative has to be computed
46 @param col2 Color to which the the new color should have less contrast
47 @param fs Factor for changing the saturation \f$(0\ldots\infty)\f$
48 @param fv Factor for interpolating the brightness \f$(0\ldots 1)\f$.
49 For 0, \f$V = V_1\f$ and for 1, \f$V = V_2\f$.
50
51 @return New color as QColor
52 */
53
54 extern OCTGUI_API QColor
55 interpolate_color (const QColor& col1, const QColor& col2,
56 double fs, double fv);
57
58}
59
60#endif
OCTGUI_API QColor interpolate_color(const QColor &col1, const QColor &col2, double fs, double fv)
Definition: gui-utils.cc:35