Commit f743469c authored by Gustavo Carneiro's avatar Gustavo Carneiro
Browse files

Move RandomizationRange class to a new file.

parent bac26d5d
......@@ -6,6 +6,7 @@ set(konsole_colorscheme_SRCS
ColorSchemeWallpaper.cpp
ColorSchemeEditor.cpp
ColorSchemeViewDelegate.cpp
RandomizationRange.cpp
)
ki18n_wrap_ui(konsole_colorscheme_SRCS
......
......@@ -9,6 +9,7 @@
// Own
#include "ColorScheme.h"
#include "hsluv.h"
#include "RandomizationRange.h"
// Qt
#include <QPainter>
......
......@@ -22,6 +22,7 @@ class QPainter;
namespace Konsole {
class RandomizationRange;
/**
* Represents a color scheme for a terminal display.
*
......@@ -145,26 +146,6 @@ public:
static QString translatedColorNameForIndex(int index);
private:
// specifies how much a particular color can be randomized by
class RandomizationRange
{
public:
RandomizationRange() : hue(0.0),
saturation(0.0),
lightness(0.0)
{
}
bool isNull() const
{
return qFuzzyIsNull(hue) && qFuzzyIsNull(saturation) && qFuzzyIsNull(lightness);
}
double hue;
double saturation;
double lightness;
};
// returns the active color table. if none has been set specifically,
// this is the default color table.
const QColor *colorTable() const;
......
/*
This source file is part of Konsole, a terminal emulator.
SPDX-FileCopyrightText: 2007-2008 Robert Knight <robertknight@gmail.com>
SPDX-FileCopyrightText: 2020-2020 Gustavo Carneiro <gcarneiroa@hotmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
// Own
#include "RandomizationRange.h"
// Qt
#include <QtGlobal>
namespace Konsole
{
RandomizationRange::RandomizationRange()
: hue(0.0)
, saturation(0.0)
, lightness(0.0)
{}
bool RandomizationRange::isNull() const
{
return qFuzzyIsNull(hue) && qFuzzyIsNull(saturation) && qFuzzyIsNull(lightness);
}
}
/*
This source file is part of Konsole, a terminal emulator.
SPDX-FileCopyrightText: 2007-2008 Robert Knight <robertknight@gmail.com>
SPDX-FileCopyrightText: 2020-2020 Gustavo Carneiro <gcarneiroa@hotmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef RANDOMIZATIONRANGE_H
#define RANDOMIZATIONRANGE_H
namespace Konsole
{
// specifies how much a particular color can be randomized by
class RandomizationRange
{
public:
RandomizationRange();
bool isNull() const;
double hue;
double saturation;
double lightness;
};
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment