This class is a representation of a 1D ColorScheme. More...
#include <ColorScheme1D.h>
Public Member Functions | |
ColorScheme1D (void) | |
creates a grayscale colorscheme | |
ColorScheme1D (const QColor &color1) | |
creates a hue based "one color" colorscheme | |
ColorScheme1D (const QColor &color1, const QColor &color2) | |
creates an HSV interpolated color scheme | |
QColor | getColor (double percentage) |
returns the requested color according to the created colorscheme. | |
QColor | getContrastColor (double percentage) |
returns a grayscale color that has a high contrast against the color you would get with calling getColor method. | |
void | setColor_1 (const QColor &color1) |
sets the first colorschemecolor to the color given | |
void | setColor_2 (const QColor &color2) |
sets the second colorschemecolor to the color given | |
void | setColors (const QColor &color1, const QColor &color2) |
sets the first and second colorschemecolor to the two colors given |
This class is a representation of a 1D ColorScheme.
1D means that you can get colors from an one dimensional "color space" which is created by the user by specifying a 2 color color ramp.
ColorScheme1D::ColorScheme1D | ( | void | ) |
creates a grayscale colorscheme
ColorScheme1D::ColorScheme1D | ( | const QColor & | color1 | ) |
creates a hue based "one color" colorscheme
ColorScheme1D::ColorScheme1D | ( | const QColor & | color1, | |
const QColor & | color2 | |||
) |
creates an HSV interpolated color scheme
QColor ColorScheme1D::getColor | ( | double | percentage | ) |
returns the requested color according to the created colorscheme.
percentage | floating point value between 0.0 and 1.0. A value close to 0.0 means the color is close to color1 and color2 has no influence. A value close to 1.0 means the color is close to color2 and color1 has no influence. |
QColor ColorScheme1D::getContrastColor | ( | double | percentage | ) |
returns a grayscale color that has a high contrast against the color you would get with calling getColor method.
percentage | floating point value between 0.0 and 1.0. A value close to 0.0 means the color is close to color1 and color2 has no influence. A value close to 1.0 means the color is close to color2 and color1 has no influence. |
void ColorScheme1D::setColor_1 | ( | const QColor & | color1 | ) |
sets the first colorschemecolor to the color given
void ColorScheme1D::setColor_2 | ( | const QColor & | color2 | ) |
sets the second colorschemecolor to the color given
void ColorScheme1D::setColors | ( | const QColor & | color1, | |
const QColor & | color2 | |||
) |
sets the first and second colorschemecolor to the two colors given