php-doc-en/reference/pdf/functions/pdf-setcolor.xml
Hartmut Holzgraefe 5b9fc29465 revision tags added
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78496 c90b9560-bf6c-de11-be94-00142212c4b1
2002-04-17 06:45:35 +00:00

96 lines
3.6 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/pdf.xml, last change in rev 1.42 -->
<refentry id="function.pdf-setcolor">
<refnamediv>
<refname>pdf_setcolor</refname>
<refpurpose>Sets fill and stroke color</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>pdf_setcolor</methodname>
<methodparam><type>int</type><parameter>pdf object</parameter></methodparam>
<methodparam><type>string</type><parameter>type</parameter></methodparam>
<methodparam><type>string</type><parameter>colorspace</parameter></methodparam>
<methodparam><type>float</type><parameter>c1</parameter></methodparam>
<methodparam choice="opt"><type>float</type><parameter>c2</parameter></methodparam>
<methodparam choice="opt"><type>float</type><parameter>c3</parameter></methodparam>
<methodparam choice="opt"><type>float</type><parameter>c4</parameter></methodparam>
</methodsynopsis>
<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>. 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, "both", "cmyk", 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>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->