[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: kde 3.1 -- make Keramik default?
From:       Allan Sandfeld Jensen <snowwolf () one2one-networks ! com>
Date:       2002-06-12 22:22:49
[Download RAW message or body]

On Wednesday 12 June 2002 14:29, Maksim Orlovich wrote:
>
> Actually, I am nearly done with a new recoloring algorithm that is more
> accurate and more vivid; but I'd be quite interested in what you came up
> with, too...

I have distilled the patch further so it doesnt use the colorize algorithm. 
The colorize algoritm disregarded the original hue anyway.

This gives the result most people expect when applying color-schemes on 
kstyles. Their colours are _supposed_ to be definate.

http://sneulv.dk/atlasbefore.png
http://sneulv.dk/atlasafter.png
http://sneulv.dk/win2000before.png
http://sneulv.dk/win2000after.png
http://sneulv.dk/snapshot1.png

(The last is a rare screenshot with the default colorscheme both before and 
after.)

This method however is unsatisfactory for the kwin-client as this pixmap is 
two-coloured. It seems the recolor function itself is too primitive for what 
we want. If we instead supplied it with two colours; the base and gradient 
titlebar colour, we could use the base colour for the keramik-bouble and the 
gradient for the stribes. What do you think?

greetings
`Allan
["right.patch" (text/x-diff)]

? right.patch
? wrong.patch
Index: pixmaploader.cpp
===================================================================
RCS file: /home/kde/kdelibs/kstyles/keramik/pixmaploader.cpp,v
retrieving revision 1.26
diff -u -3 -p -r1.26 pixmaploader.cpp
--- pixmaploader.cpp	2002/06/04 03:42:18	1.26
+++ pixmaploader.cpp	2002/06/12 21:43:13
@@ -67,13 +67,11 @@ QImage* PixmapLoader::getColored(int nam
 	QImage* img = new QImage(edata->width, edata->height, 32);
 	img->setAlphaBuffer(true);
 
-
 	//OK, now, fill it in, using the color..
 	int hue = -1, sat = 0, val = 228;
 	if ( color.isValid() ) color.hsv( &hue, &sat, &val );
-
 	
-	Q_UINT32* write = reinterpret_cast< Q_UINT32* >(img->bits() );
+	Q_UINT32* write = (Q_UINT32*)img->bits();
 	int size = img->width()*img->height() * 4;
 
 	for (int pos = 0; pos < size; pos+=4)
@@ -86,9 +84,9 @@ QImage* PixmapLoader::getColored(int nam
 		QColor c( red, green, blue );
 		int h, s, v;
 		c.hsv( &h, &s, &v );
-		if ( hue >= 0 && h >= 0 ) h = ( h + 144 + hue ) % 360;
-		if ( s ) s += sat / 2;
-		c.setHsv( h, QMIN( s, 255 ), QMIN( v * val / 228, 255 ) );
+		h = hue;
+		s = sat;
+		c.setHsv( h, s, QMIN( v * val / 228, 255 ) );
 		*write = qRgba( c.red(), c.green(), c.blue(), alpha );
 		write++;
 	}
@@ -129,9 +127,9 @@ QImage* PixmapLoader::getDisabled(int na
 		QColor c( red, green, blue );
 		int h, s, v;
 		c.hsv( &h, &s, &v );
-		if ( hue >= 0 && h >= 0 ) h = ( h + 144 + hue ) % 360;
-		if ( s ) s += sat / 5;
-		c.setHsv( h, QMIN( s, 255 ), QMIN( v * val / 255, 255 ) );
+		h = hue;
+		s = sat;
+		c.setHsv( h, s, QMIN( v * val / 255, 255 ) );
 
 		*write =qRgba(c.red(), c.green(), c.blue(), alpha);
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic