First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
if(!defined('IN_CB'))die('You are not allowed to access to this page.');
|
||||
|
||||
/**
|
||||
* Holds Color in RGB Format.
|
||||
*/
|
||||
class FColor {
|
||||
protected $r,$g,$b; // int Hexadecimal Value
|
||||
|
||||
/**
|
||||
* Save RGB value into the classes
|
||||
*
|
||||
* @param int $r
|
||||
* @param int $g
|
||||
* @param int $b
|
||||
*/
|
||||
public function __construct($r,$g,$b){
|
||||
$this->r = $r;
|
||||
$this->g = $g;
|
||||
$this->b = $b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Red Color
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function r(){
|
||||
return $this->r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Green Color
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function g(){
|
||||
return $this->g;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns Blue Color
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function b(){
|
||||
return $this->b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the int value for PHP color
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function allocate($im) {
|
||||
return imagecolorallocate($im,$this->r,$this->g,$this->b);
|
||||
}
|
||||
};
|
||||
?>
|
||||
Reference in new issue
Block a user