You are here

function pChart::AllocateColor in Visitors 8

Same name and namespace in other branches
  1. 7.0 pchart/pChart.inc \pChart::AllocateColor()
1 call to pChart::AllocateColor()
pChart::drawPieGraph in pchart/pChart.inc

File

pchart/pChart.inc, line 2436

Class

pChart

Code

function AllocateColor($Picture, $R, $G, $B, $Factor = 0) {
  $R = $R + $Factor;
  $G = $G + $Factor;
  $B = $B + $Factor;
  if ($R < 0) {
    $R = 0;
  }
  if ($R > 255) {
    $R = 255;
  }
  if ($G < 0) {
    $G = 0;
  }
  if ($G > 255) {
    $G = 255;
  }
  if ($B < 0) {
    $B = 0;
  }
  if ($B > 255) {
    $B = 255;
  }
  return imagecolorallocate($Picture, $R, $G, $B);
}