| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="475UnderstandingtextalignmentinJpGraph.html">
|
|
|
8 |
<LINK REL="Next" HREF="481Adjustingthetransparency.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="475UnderstandingtextalignmentinJpGraph.html">Previous</A>
|
|
|
26 |
<A HREF="481Adjustingthetransparency.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H2><A NAME="4_8">4.8 Specifying colors in JpGraph</A></H2>
|
|
|
29 |
<P> Colors can be specified in three different ways</P>
|
|
|
30 |
<OL>
|
|
|
31 |
<LI> By using one of the, roughly, 400 pre-defined color names, e.g<DIV class="phpscript">
|
|
|
32 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> SetColor</FONT><FONT color="#007700">
|
|
|
33 |
(</FONT><FONT color="#DD0000">"khaki"</FONT><FONT color="#007700">);</FONT><FONT
|
|
|
34 |
color="#0000BB"></FONT></FONT></CODE></DIV>
|
|
|
35 |
<P> A named color can also be modified by adding a adjustment factor. An
|
|
|
36 |
adjustment factor, 0 < f < 1, a smaller value will give a darker
|
|
|
37 |
version and a value of 0 or 1 will return the original color. A value >
|
|
|
38 |
1 will make the color brighter. A few examples<DIV class="phpscript"><CODE>
|
|
|
39 |
<FONT color="#000000"> <FONT color="#0000BB"> SetColor</FONT><FONT color="#007700">
|
|
|
40 |
(</FONT><FONT color="#DD0000">"khaki:0.5"</FONT><FONT color="#007700">
|
|
|
41 |
); </FONT><FONT color="#FF8000">// A darker version of "khaki"
|
|
|
42 |
<BR></FONT><FONT color="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONT
|
|
|
43 |
color="#DD0000">"yellow:1.2"</FONT><FONT color="#007700">); </FONT><FONT color="#FF8000">
|
|
|
44 |
// A slightly lighter version of "yellow"</FONT><FONT color="#0000BB"></FONT>
|
|
|
45 |
</FONT></CODE></DIV></P>
|
|
|
46 |
<P></P>
|
|
|
47 |
</LI>
|
|
|
48 |
<LI> By specifying a RGB triple, e.g.<DIV class="phpscript"><CODE><FONT color="#000000">
|
|
|
49 |
<FONT color="#0000BB"> SetColor</FONT><FONT color="#007700">(array(</FONT><FONT
|
|
|
50 |
color="#0000BB">65</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
51 |
100</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">176</FONT><FONT
|
|
|
52 |
color="#007700">));</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV>
|
|
|
53 |
<P></P>
|
|
|
54 |
</LI>
|
|
|
55 |
<LI> By specifying the color as a hex string value<DIV class="phpscript">
|
|
|
56 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> SetColor</FONT><FONT color="#007700">
|
|
|
57 |
(</FONT><FONT color="#DD0000">"#A16BFF"</FONT><FONT color="#007700">);</FONT><FONT
|
|
|
58 |
color="#0000BB"></FONT></FONT></CODE></DIV>
|
|
|
59 |
<P></P>
|
|
|
60 |
</LI>
|
|
|
61 |
</OL>
|
|
|
62 |
<P></P>
|
|
|
63 |
<HR NOSHADE>
|
|
|
64 |
<A HREF="toc.html">Contents</A>
|
|
|
65 |
<A HREF="475UnderstandingtextalignmentinJpGraph.html">Previous</A>
|
|
|
66 |
<A HREF="481Adjustingthetransparency.html">Next</A>
|
|
|
67 |
</BODY>
|
|
|
68 |
</HTML>
|