You are here

function pDraw::allocateColor in Visitors 7.2

Same name and namespace in other branches
  1. 7 pChart/class/pDraw.class.php \pDraw::allocateColor()
14 calls to pDraw::allocateColor()
pDraw::drawAlphaPixel in pChart/class/pDraw.class.php
pDraw::drawAntialiasPixel in pChart/class/pDraw.class.php
pDraw::drawArrow in pChart/class/pDraw.class.php
pDraw::drawFilledCircle in pChart/class/pDraw.class.php
pDraw::drawFilledRectangle in pChart/class/pDraw.class.php

... See full list

File

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);
}