PHP匹配顏色函數(shù)的使用技巧
PHP匹配顏色函數(shù)為imagecolorallocate,許多PHP程序員們在處理圖形的時候,經(jīng)常會用到這一函數(shù)。下面我們就為大家具體介紹這一函數(shù)的相關(guān)用法。#t#
定義
匹配顏色。
語法:
int imagecolorallocate(int im, int red, int green, int blue);
返回值:
整數(shù)
函數(shù)種類:
圖形處理
PHP匹配顏色函數(shù)內(nèi)容說明:
本函數(shù)用來匹配圖形的顏色,供其它繪圖函數(shù)使用。參數(shù) im 表示圖形的 handle。參數(shù) red、green、blue 是色彩三原色,其值從 0 至 255。
PHP匹配顏色函數(shù)使用范例:
- < ?
- $white = imagecolorallocate
($im, 255,255,255);- $black = imagecolorallocate
($im, 0,0,0);- ?>