<?php
/*
osCommRes, Services Online 
http://www.oscommres.com 
Copyright (c) 2005 osCommRes 

Freeway eCommerce 
http://www.zac-ware.com/freeway 
Copyright (c) 2007 ZacWare

Released under the GNU General Public License 
*/
if(!defined('IN_CB'))die('You are not allowed to access to this page.');

/**
 * Holds Color in RGB Format.
 */
class FColor {
	var $r,$g,$b;	// int Hexadecimal Value

	/**
	 * Save RGB value into the classes
	 *
	 * @param int $r
	 * @param int $g
	 * @param int $b
	 */
	function FColor($r,$g,$b){
		$this->r = $r;
		$this->g = $g;
		$this->b = $b;
	}

	/**
	 * Returns Red Color
	 *
	 * @return int
	 */
	function r(){
		return $this->r;
	}

	/**
	 * Returns Green Color
	 *
	 * @return int
	 */
	function g(){
		return $this->g;
	}

	/**
	 * Returns Blue Color
	 *
	 * @return int
	 */
	function b(){
		return $this->b;
	}

	/**
	 * Returns the int value for PHP color
	 *
	 * @param ressource $im
	 * @return int
	 */
	function allocate($im) {
		return imagecolorallocate($im,$this->r,$this->g,$this->b);
	}
};
?>