1 17 18 19 20 package org.apache.fop.fo.expr; 21 import org.apache.fop.apps.FOUserAgent; 22 import org.apache.fop.fo.properties.ColorProperty; 23 import org.apache.fop.fo.properties.Property; 24 25 28 class CMYKcolorFunction extends FunctionBase { 29 30 34 public int nbArgs() { 35 return 4; 36 } 37 38 39 public Property eval(Property[] args, 40 PropertyInfo pInfo) throws PropertyException { 41 StringBuffer sb = new StringBuffer (); 42 sb.append("cmyk(" + args[0] + "," + args[1] + "," + args[2] + "," + args[3] + ")"); 43 FOUserAgent ua = (pInfo == null) 44 ? null 45 : (pInfo.getFO() == null ? null : pInfo.getFO().getUserAgent()); 46 return new ColorProperty(ua, sb.toString()); 47 } 48 49 50 } 51 | Popular Tags |