Home  >  Article  >  php教程  >  PHP匹配颜色函数的使用技巧

PHP匹配颜色函数的使用技巧

WBOY
WBOYOriginal
2016-06-13 11:10:351161browse

定义

匹配颜色。

语法:

int imagecolorallocate(int im, int red, int green, int blue);

返回值:

整数

函数种类:

图形处理

PHP匹配颜色函数内容说明:

本函数用来匹配图形的颜色,供其它绘图函数使用。参数 im 表示图形的 handle。参数 red、green、blue 是色彩三原色,其值从 0 至 255。

PHP匹配颜色函数使用范例:

<ol class="dp-xml">
<li class="alt"><span><span class="tag"><span> ?  </span></span></span></li>
<li>
<span>$</span><span class="attribute">white</span><span> = </span><span class="attribute-value">imagecolorallocate<br></span><span>($im, 255,255,255);  </span>
</li>
<li class="alt">
<span>$</span><span class="attribute">black</span><span> = </span><span class="attribute-value">imagecolorallocate<br></span><span>($im, 0,0,0);  </span>
</li>
<li>
<span class="tag">?></span><span> </span>
</li>
</ol>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn