# HG changeset patch # User Anton Epple # Date 1369641612 -7200 # Node ID 6ef06b72bb063ae2ffae1a05b49f8c9fd86caf0d # Parent 0e2c3676d77ab673325d7006f918080475880236 Added Color as style diff -r 0e2c3676d77a -r 6ef06b72bb06 javaquery/canvas/src/main/java/net/java/html/canvas/Color.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Color.java Mon May 27 10:00:12 2013 +0200 @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.java.html.canvas; + +/** + * + * @author antonepple + */ +public class Color extends Style{ + + String web; + + /** + * Creates an RGB color specified with an HTML or CSS attribute string. + * @param webColor Colordefined as + */ + Color(String webColor) { + this.web = web; + } + + public String getAsString(){ + return web; + } + +} diff -r 0e2c3676d77a -r 6ef06b72bb06 javaquery/canvas/src/main/java/net/java/html/canvas/Style.java --- a/javaquery/canvas/src/main/java/net/java/html/canvas/Style.java Mon May 27 08:30:30 2013 +0200 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/Style.java Mon May 27 10:00:12 2013 +0200 @@ -41,6 +41,10 @@ return new Pattern(imageResource, repeat); } + public static final Color createColor(String webColor) { + return new Color(webColor); + } + void cache(Object toCache) { cacheHash = hashCode(); this.cached = toCache;