Usage of system colors in amarok theme

Manuel Mommertz 2Kmm at gmx.de
Sun Mar 20 23:10:15 CET 2011


Hello,

amarok uses a helper class 'SvgTinter' to replace defined colors with system 
colors. This class is used to load the SVG-file that contains amarok's theme. 
The rendering of the elements is done by plasma.
Since release 4.6 plasma allows SVG's to use different system colors too. This 
is done with help of CSS-styling. For more details see 
http://techbase.kde.org/Projects/Plasma/Theme#Using_system_colors

I thought that amarok maybe want to switch to this system in some future 
releases. As a conversion of the current theme is very easy I just tried it.
Here it is how it looks now:

http://wstaw.org/m/2011/03/20/amarok-plasmaColored.png

And to have something to compare, here is a screenshot with the current 
unchanged theme:

http://wstaw.org/m/2011/03/20/amarok-selfColored.png

The only difference is that the highlight-color is currently not provided by 
plasma and therfore I used the hover color from buttons for now. But it is no 
problem to allow this color in svg's in future releases of plasma.

Here is the command I used to convert the theme:

svgmod -a current-color-scheme ColorScheme-Background '#c0c0c0' \
       -a current-color-scheme ColorScheme-Text '#000000' \
       -a current-color-scheme ColorScheme-ViewBackground '#ffffff' \
       -a current-color-scheme ColorScheme-ButtonHover '#6060ff' \
       -a current-color-scheme ColorScheme-ButtonFocus '#a0a0c0' \
       default-theme*.svg

svgmod -c '#666765' ColorScheme-Background \
       -c '#66ffff' ColorScheme-ButtonHover \
       -c '#e8e8e8' ColorScheme-Background \
       -c '#565755' ColorScheme-Background \
       -c '#f0f0f0' ColorScheme-ViewBackground \
       -c '#e0e0e0' ColorScheme-ViewBackground \
       -c '#123456' ColorScheme-ButtonFocus \
       -c '#010101' ColorScheme-Text \
       default-theme*.svg

You find svgmod at 
https://projects.kde.org/projects/playground/devtools/svgmod

If you set the css-classes to the same colors as the elements currently use, 
the SvgTinter class still works for older plasma releases. This allows a 
smooth transition now, and SvgTinter can be removed somewhere in the future 
when amarok depends an plasma > 4.6.

So what do you think? Any open questions?

Greets
Manuel Mommertz


More information about the Amarok-devel mailing list