function pDraw::allocateColor

5.x pDraw.class.php pDraw::allocateColor($Picture, $R, $G, $B, $Alpha = 100)
14 calls to pDraw::allocateColor()
pDraw::drawAlphaPixel in inc/pchart/pchart/class/pDraw.class.php
pDraw::drawAntialiasPixel in inc/pchart/pchart/class/pDraw.class.php
pDraw::drawArrow in inc/pchart/pchart/class/pDraw.class.php
pDraw::drawFilledCircle in inc/pchart/pchart/class/pDraw.class.php
pDraw::drawFilledRectangle in inc/pchart/pchart/class/pDraw.class.php

... See full list

File

inc/pchart/pchart/class/pDraw.class.php, line 1195

Class

pDraw

Code

function allocateColor($Picture, $R, $G, $B, $Alpha = 100) 
 {
  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;
  }
  if ($Alpha < 0) {
    $Alpha = 0;
  }
  if ($Alpha > 100) {
    $Alpha = 100;
  }

  $Alpha = $this->convertAlpha($Alpha);
  return (imagecolorallocatealpha($Picture, $R, $G, $B, $Alpha));
}