#include <colorcircle.h>
Signals | |
void | colorChanged (const rColor &) |
Public Member Functions | |
ColorCircle (QWidget *parent=0, const char *name=0, WFlags f=0) | |
~ColorCircle () | |
void | setColor (const rColor &) |
Protected Member Functions | |
void | drawContents (QPainter *) |
void | mouseReleaseEvent (QMouseEvent *) |
Private Member Functions | |
void | makeCircle () |
void | makeTriangle (int) |
double | arcTan (double, double) |
void | calcVertices (int, int *, int *, int *, int *, int *, int *) |
bool | isInTriangle (int, int) |
void | calcSV (int, int, int *, int *) |
void | calcCoords (int *, int *) |
Private Attributes | |
QWMatrix | wm |
QSize | palSize |
QSize | frameSize |
QPixmap | cpm |
QPixmap | tpm |
QPixmap | bg |
double | innerRadius |
double | outerRadius |
double | center |
int | icenter |
int | irad |
int | orad |
int | currentHue |
int | currentSat |
int | currentVal |
int | currentAlpha |
double | circleWidth |
|
The c'tor sets up the geometry for a fixed size of 160 pixels square. It sets up a default color with hue = 0, saturation = 255, and value = 255;
Here is the call graph for this function: |
|
|
|
Returns the arcus tangent for x, y in the range of 0 <= retVal < 2π. Is not much used though, as it turns out. |
|
Calculate adequate coordinates for the currently seleced color. Sometimes the results are a bit unexpected, as can be seen when selecting a color in the triangle. This is later displayed - a circle is shown - using this function. Here is the call graph for this function: |
|
Calculate values for Saturation and Value based on coords in the triangle. Adopted from gtk. Here is the call graph for this function: |
|
Calculates the vertices of the triangle for a given hue. |
|
|
|
Reimplemented to draw the two small circles whenever the widget needs updating. The triangle and the circle are already defined as background image. Here is the call graph for this function: |
|
Check if a given coord can be found inside the triangle. Here is the call graph for this function: |
|
Creates the chromatic circle on a grey background. The circle is rotated so that the color red ( hue = 0 ) is at the top. Here is the call graph for this function: |
|
Draw the triangle with the correct shadings for the current hue. This code was adopted from gtk and adapted to fit in the general philosphy of the color dialog. Here is the call graph for this function: |
|
We check the mouseReleaseEvent, assuming something has been clicked. If the event took place in the circle, we adjust the current hue. In the triangle we adjust Saturation and Value. Here is the call graph for this function: |
|
Sets the currently displayed rColor to col. Here is the call graph for this function: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|