Blame | Letzte Änderung | Log anzeigen | RSS feed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1"><LINK REL="Start" HREF="index.html"><LINK REL="Contents" HREF="toc.html"><LINK REL="Prev" HREF="475UnderstandingtextalignmentinJpGraph.html"><LINK REL="Next" HREF="481Adjustingthetransparency.html"><STYLE TYPE="text/css"><!--BODY { font-family: serif }H1 { font-family: sans-serif }H2 { font-family: sans-serif }H3 { font-family: sans-serif }H4 { font-family: sans-serif }H5 { font-family: sans-serif }H6 { font-family: sans-serif }SUB { font-size: smaller }SUP { font-size: smaller }PRE { font-family: monospace }A { text-decoration: none }--></STYLE></HEAD><BODY><A HREF="toc.html">Contents</A><A HREF="475UnderstandingtextalignmentinJpGraph.html">Previous</A><A HREF="481Adjustingthetransparency.html">Next</A><HR NOSHADE><H2><A NAME="4_8">4.8 Specifying colors in JpGraph</A></H2><P> Colors can be specified in three different ways</P><OL><LI> By using one of the, roughly, 400 pre-defined color names, e.g<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"khaki"</FONT><FONT color="#007700">);</FONT><FONTcolor="#0000BB"></FONT></FONT></CODE></DIV><P> A named color can also be modified by adding a adjustment factor. Anadjustment factor, 0 < f < 1, a smaller value will give a darkerversion and a value of 0 or 1 will return the original color. A value >1 will make the color brighter. A few examples<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"khaki:0.5"</FONT><FONT color="#007700">); </FONT><FONT color="#FF8000">// A darker version of "khaki"<BR></FONT><FONT color="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONTcolor="#DD0000">"yellow:1.2"</FONT><FONT color="#007700">); </FONT><FONT color="#FF8000">// A slightly lighter version of "yellow"</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P><P></P></LI><LI> By specifying a RGB triple, e.g.<DIV class="phpscript"><CODE><FONT color="#000000"><FONT color="#0000BB"> SetColor</FONT><FONT color="#007700">(array(</FONT><FONTcolor="#0000BB">65</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">100</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">176</FONT><FONTcolor="#007700">));</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV><P></P></LI><LI> By specifying the color as a hex string value<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"#A16BFF"</FONT><FONT color="#007700">);</FONT><FONTcolor="#0000BB"></FONT></FONT></CODE></DIV><P></P></LI></OL><P></P><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="475UnderstandingtextalignmentinJpGraph.html">Previous</A><A HREF="481Adjustingthetransparency.html">Next</A></BODY></HTML>