ch07.html 4.68 KB
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 7. Color handling</title><link rel="stylesheet" type="text/css" href="manual.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.0"><link rel="home" href="index.html" title="JpGraph Manual"><link rel="up" href="pt02.html" title="Part II. Basic graph creation"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 7. Color handling</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center">Part II. Basic graph creation</th><td width="20%" align="right"> </td></tr></table><hr></div><div class="chapter" title="Chapter 7. Color handling"><div class="titlepage"><div><div><h2 class="title"><a name="chap.color-handling"></a>Chapter 7. Color handling</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ch07.html#id2496153">7.1. Specifying colors by name</a></span></dt><dt><span class="sect1"><a href="ch07s02.html">7.2. Specifying colors by RGB triples</a></span></dt><dt><span class="sect1"><a href="ch07s03.html">7.3. Using HTML color specifications</a></span></dt><dt><span class="sect1"><a href="ch07s04.html">7.4. Fine tuning the color</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch07s04.html#sec2.alpha-channel">7.4.1. Specifying the alpha channel (color transparency)</a></span></dt><dt><span class="sect2"><a href="ch07s04.html#id2496356">7.4.2. Adjusting the brightness</a></span></dt><dt><span class="sect2"><a href="ch07s04.html#id2496665">7.4.3. Combining brightness and transparency adjustment</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch07s05.html">7.5. Additional color handling</a></span></dt></dl></div>
        
        <p>An important part of creating visually clear graphs is the use of appropriate colors.
            In order to simplify color handling JpGraph supports several ways to adjust and
            manipulate color both by value and by name. </p>
        <p>Almost all color setting methods (with basically only one exception) for all objects
            in the graph has one of two names</p>
        <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
                    <p><code class="code">SetColor()</code>, Sets the outline color or if the object only have
                        one color (e.g. a font) it sets this color</p>
                </li><li class="listitem">
                    <p><code class="code">SetFillColor()</code>, Specifies the area fill color for objects
                        which has a concept of an area.</p>
                </li></ul></div><p>Both variants of methods take one argument which identifies the color by
            one of the available color specification methods as described below.</p>
        <div class="sect1" title="Specifying colors by name"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2496153"></a>Specifying colors by name</h2></div></div></div>
            
            <p>There are a number of "standard colors" known by (more or less) illustrative
                names. A list of all color names that can be used as well as actual color can be
                found in <a class="xref" href="apd.html" title="Appendix D. Named color list">Appendix D. <i>Named color list</i></a>. </p>
            <p>For example:</p>
            <p>
                </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
                        <p><code class="code">SetColor('white');</code></p>
                    </li><li class="listitem">
                        <p><code class="code">SetFillColor('orange');</code></p>
                    </li></ul></div><p>
            </p>
            <p>
                </p><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3>
                    <p>Always use single quotes for strings when you do not need variable
                        substitution since this is faster.</p>
                </div><p>
            </p>
        </div>
        
        
        
        
    </div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"><a accesskey="u" href="pt02.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>