summaryrefslogtreecommitdiffstats
path: root/src/misc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index 966f7b1..9963407 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -24,13 +24,13 @@
#include <kpixmap.h>
#include <kpixmapeffect.h>
-#include <qcolor.h>
-#include <qimage.h>
-#include <qpainter.h>
+#include <tqcolor.h>
+#include <tqimage.h>
+#include <tqpainter.h>
#include "misc.h"
-QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS, int relativeV)
+TQColor hsvRelative(TQColor& baseColor, int relativeH, int relativeS, int relativeV)
{
int h, s, v;
baseColor.hsv(&h, &s, &v);
@@ -46,38 +46,38 @@ QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS, int relative
if(v < 0) { v = 0; }
else if(v > 255) { v = 255; }
- QColor c;
+ TQColor c;
c.setHsv( h, s, v );
return c;
}
-QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a)
+TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const int a)
{
// normal button...
- QRgb rgb = bgColor.rgb();
- QRgb rgb_b = fgColor.rgb();
+ TQRgb rgb = bgColor.rgb();
+ TQRgb rgb_b = fgColor.rgb();
int alpha = a;
if(alpha>255) alpha = 255;
if(alpha<0) alpha = 0;
int inv_alpha = 255 - alpha;
- QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255,
- qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255,
- qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) );
+ TQColor result = TQColor( tqRgb(tqRed(rgb_b)*inv_alpha/255 + tqRed(rgb)*alpha/255,
+ tqGreen(rgb_b)*inv_alpha/255 + tqGreen(rgb)*alpha/255,
+ tqBlue(rgb_b)*inv_alpha/255 + tqBlue(rgb)*alpha/255) );
return result;
}
-QImage recolorImage(QImage *img, QColor color) {
- QImage destImg(img->width(),img->height(),32);
+TQImage recolorImage(TQImage *img, TQColor color) {
+ TQImage destImg(img->width(),img->height(),32);
destImg.setAlphaBuffer(true);
for (int x = 0; x < img->width(); x++) {
for (int y = 0; y < img->height(); y++) {
- if(img->pixel(x,y) == qRgb(0,0,0)) {
+ if(img->pixel(x,y) == tqRgb(0,0,0)) {
destImg.setPixel(x,y,color.rgb() ); // set to the new color
} else {
- destImg.setPixel(x,y,qRgba(0,0,0,0) ); // set transparent...
+ destImg.setPixel(x,y,tqRgba(0,0,0,0) ); // set transparent...
}
}
}