jimw Thu Dec 20 16:07:53 2001 EDT
Modified files:
/phpdoc/en/functions pdf.xml
Log:
pdf_setcolor: add examples, clarify range for color values
Index: phpdoc/en/functions/pdf.xml
diff -u phpdoc/en/functions/pdf.xml:1.74 phpdoc/en/functions/pdf.xml:1.75
--- phpdoc/en/functions/pdf.xml:1.74 Tue Dec 18 18:37:31 2001
+++ phpdoc/en/functions/pdf.xml Thu Dec 20 16:07:53 2001
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.74 $ -->
+<!-- $Revision: 1.75 $ -->
<reference id="ref.pdf">
<title>PDF functions </title>
<titleabbrev>PDF</titleabbrev>
@@ -2099,7 +2099,7 @@
<refentry id="function.pdf-setcolor">
<refnamediv>
<refname>pdf_setcolor</refname>
- <refpurpose>Sets fill and stroke color to CMYK values</refpurpose>
+ <refpurpose>Sets fill and stroke color</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@@ -2116,31 +2116,57 @@
</funcprototype>
</funcsynopsis>
<para>
- Set the current color space and color. The parameter
- <parameter>type</parameter> can be "fill", "stroke", or "both"
- to specify that the color is set for filling, stroking or both
- filling and stroking. The parameter
- <parameter>colorspace</parameter> can be
- <literal>gray</literal>, <literal>rgb</literal>,
- <literal>cmyk</literal>, <literal>spot</literal> or
- <literal>pattern</literal>. The parameters
- <parameter>c1</parameter>, <parameter>c2</parameter>,
- <parameter>c3</parameter> and <parameter>c4</parameter>
- represent the color components for the color space specified by
- <parameter>colorspace</parameter>. For <literal>gray</literal> only
- <parameter>c1</parameter> is used. For <literal>rgb</literal> parameters
- <parameter>c1</parameter>, <parameter>c2</parameter>, and
- <parameter>c3</parameter> specify the Red, Green amd Blue values
- respectively.
- For <literal>cmyk</literal> parameters <parameter>c1</parameter>,
- <parameter>c2</parameter>, <parameter>c3</parameter>, and
- <parameter>c4</parameter> specify the Cyan, Magenta, Yellow and
- Black values respectively.
- For <literal>spot</literal> <parameter>c1</parameter> specifies
- a spot color handles returned by <function>pdf_makespotcolor</function>
- and <parameter>c2</parameter> specifies a tint value between 0 and 1.
- For <literal>pattern</literal> <parameter>c1</parameter> specifies
- a pattern handle returned by <function>pdf_begin_pattern</function>.
+ Set the current color space and color. The parameter
+ <parameter>type</parameter> can be "fill", "stroke", or "both" to
+ specify that the color is set for filling, stroking or both filling and
+ stroking. The parameter <parameter>colorspace</parameter> can be
+ <literal>gray</literal>, <literal>rgb</literal>,
+ <literal>cmyk</literal>, <literal>spot</literal> or
+ <literal>pattern</literal>. The parameters <parameter>c1</parameter>,
+ <parameter>c2</parameter>, <parameter>c3</parameter> and
+ <parameter>c4</parameter> represent the color components for the color
+ space specified by <parameter>colorspace</parameter>. Except as
+ otherwise noted, the color components are floating-point values that
+ range from 0 to 1.
+ </para>
+ <para>
+ For <literal>gray</literal> only <parameter>c1</parameter> is used.
+ </para>
+ <para>
+ For <literal>rgb</literal> parameters <parameter>c1</parameter>,
+ <parameter>c2</parameter>, and <parameter>c3</parameter> specify the
+ red, green and blue values respectively.
+ <informalexample>
+ <programlisting role="php">
+<![CDATA[
+// Set fill and stroke colors to white.
+pdf_setcolor($pdf, "both", "rgb", 1, 1, 1);
+]]>
+ </programlisting>
+ </informalexample>
+ </para>
+ <para>
+ For <literal>cmyk</literal>, parameters <parameter>c1</parameter>,
+ <parameter>c2</parameter>, <parameter>c3</parameter>, and
+ <parameter>c4</parameter> are the cyan, magenta, yellow and black
+ values, respectively.
+ <informalexample>
+ <programlisting role="php">
+<![CDATA[
+// Set fill and stroke colors to white.
+pdf_setcolor($pdf, "cmyk", "rgb", 0, 0, 0, 1);
+]]>
+ </programlisting>
+ </informalexample>
+ </para>
+ <para>
+ For <literal>spot</literal>, <parameter>c1</parameter> should be
+ a spot color handles returned by <function>pdf_makespotcolor</function>
+ and <parameter>c2</parameter> is a tint value between 0 and 1.
+ </para>
+ <para>
+ For <literal>pattern</literal>, <parameter>c1</parameter> should be
+ a pattern handle returned by <function>pdf_begin_pattern</function>.
</para>
</refsect1>
</refentry>