KDE 4.0

Matthew Woehlke mw_triad at users.sourceforge.net
Wed Jun 10 21:04:00 BST 2009


Boyd Stephen Smith Jr. wrote:
> In <h0ovft$c2i$1 at ger.gmane.org>, Matthew Woehlke wrote:
>> Boyd Stephen Smith Jr. wrote:
>>> Either an XGM or a greyscale SVG for each of {NeutralBackground,
>>> AlternateBackground, Normal, Inactive, Active, Link, Visited, Negative,
>>> NeutralText, Positive, Focus, Hover} and composite them at runtime, then
>>> apply a final XGM or greyscale SVG as alpha channel.
>> No, no, no, terrible ;-). Dynamic color replacement. That's where it's
>> at, I say; rewriting the colors specified in the DOM. (I've had this
>> idea for a while, just no time to implement it, unfortunately. SVG rocks
>> that way. Hmm, but then you do have to actually /use/ svg, and not just
>> raster-in-svg, but...)
> 
> That sounds like a pretty good idea.  A very simple xslt that replaces  
> (e.g.) $KColor$Neutral$$ in attributes with the actual value, and replaces 
> the <kde:KColor>Neutral</kde:KColor> with something similar.  But then, the 
> SVG wouldn't really be SVG.

That wouldn't work, it would be almost impossible to edit :-).

> Or, perhaps you mean something where the SVG is still valid, but based on 
> some other file it has a dynamically generated xslt applied to it?

Yes, that. I literally meant replace e.g. #ffefc2 with something else 
(where I'm thinking "something else" is an RPN* expression that produces 
a color).

(* Reverse Polish Notation. Also known as "Forth without flow control or 
non-builtin words". Forth is beautiful :-).)

One reason for such an approach is, as previously mentioned, it can be 
retrofitted onto existing themes without modifying the SVG.

> Can't most of this really be handled with SVG+CSS3, by having some 
> additional colors recognized by the CSS3 parser, like x-kcolor-neutral?

Well... no. You can't implement expressions that way, which means you 
have to composite colors with what SVG provides (which can be very 
difficult for some things that would be easy with expressions). And I 
think there is still the 'how do you edit it' problem.

IOW, in my opinion, any solution that requires hand-editing the SVG is a 
no-go.

>> (Seriously, if you want to implement your idea, I'd welcome the
>> addition, especially since yours works with raster.)
> 
> Heh.  I'll add it to my TODO list, after finishing the donation tracker for 
> my local FreeGeek and getting the Valknut Debian package in order.

:-)

If you want to work on a replacement scheme, let me know; I should be 
able to build the expression engine in short order. (I've already done 
one that works only on integers, it needs to be extended to support 
multiple data types (colors and reals) but the rest is pretty straight 
forward, code-monkey-skill-level stuff.)

Of course, that's because it's RPN. RPN expression engines are dead 
simple to build, especially when you have a good library like Qt to do 
the bookkeeping :-).

-- 
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
-- 
"For UNIX thou art, and to UNIX thou shalt return"
The voice of Freedom speaks to the Internet

___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list