You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by John Hon <jo...@mail.com> on 2003/10/29 02:00:44 UTC

CSS question

Hello! I have been using Batik and its very nice!

How can I use batik CSS parser to parse CSS color values (like "blanchedalmond") into an RGB color? 
This seems very difficult.. not sure how about to go with it.
-- 
__________________________________________________________
Sign-up for your own personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: CSS question

Posted by Thomas DeWeese <Th...@Kodak.com>.
John Hon wrote:

> Hello! I have been using Batik and its very nice!
> 
> How can I use batik CSS parser to parse CSS color values 
> (like "blanchedalmond") into an RGB color? 
> This seems very difficult.. not sure how about to go with it.

   I guess I am unsure what exactly you are trying to do.

   It is difficult to use the CSS Parser 'outside' of CSS
(so for example just parse this value).  However if you have
an element and you want the value of it's 'fill' property
as a CSSRGBColor or a Graphics2D PaintServer it is pretty simple.

   Can you give more information on what you are trying to do?



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: CSS question

Posted by Matthew Good <ma...@virginia.edu>.
Well, the ColorManager class in org.apache.batik.css.engine.value.svg
builds a Map from color names to values.  Unfortunately you can't get to
this Map from the public interface.  You could pull the necessary code
out of this class and it's superclass to build this Map yourself.  It's
really pretty simple; just grab the code which builds the computedValues
StringMap, then once you've built your own Map you can lookup the values
based on the name.

-Matt

On Tue, 2003-10-28 at 20:00, John Hon wrote:
> Hello! I have been using Batik and its very nice!
> 
> How can I use batik CSS parser to parse CSS color values (like "blanchedalmond") into an RGB color? 
> This seems very difficult.. not sure how about to go with it.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org