本文整理汇总了PHP中ezcGraphColor::darken方法的典型用法代码示例。如果您正苦于以下问题:PHP ezcGraphColor::darken方法的具体用法?PHP ezcGraphColor::darken怎么用?PHP ezcGraphColor::darken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ezcGraphColor
的用法示例。
在下文中一共展示了ezcGraphColor::darken方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drawCircularBar
/**
* Draws a bar with a circular ground shape.
*
* @param ezcGraphContext $context
* @param ezcGraphColor $color
* @param ezcGraphCoordinate $position
* @param float $barWidth
* @param float $offset
* @param float $axisPosition
* @param float $startDepth
* @param float $midDepth
* @param float $endDepth
* @param int $symbol
* @return void
*/
protected function drawCircularBar(ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $position, $barWidth, $offset, $axisPosition, $startDepth, $midDepth, $endDepth, $symbol)
{
$barCenterTop = new ezcGraphCoordinate($this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ($this->dataBoundings->x1 - ($this->dataBoundings->x0 + 2 * $this->xAxisSpace)) + $offset + $barWidth / 2, $this->dataBoundings->y0 + $this->yAxisSpace + $position->y * ($this->dataBoundings->y1 - ($this->dataBoundings->y0 + 2 * $this->yAxisSpace)));
$barCenterBottom = new ezcGraphCoordinate($this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ($this->dataBoundings->x1 - ($this->dataBoundings->x0 + 2 * $this->xAxisSpace)) + $offset + $barWidth / 2, $this->dataBoundings->y0 + $this->yAxisSpace + $axisPosition * ($this->dataBoundings->y1 - ($this->dataBoundings->y0 + 2 * $this->yAxisSpace)));
if ($barCenterTop->y > $barCenterBottom->y) {
$tmp = $barCenterTop;
$barCenterTop = $barCenterBottom;
$barCenterBottom = $tmp;
}
$this->barPostProcessing[] = array('index' => $barCenterBottom->x, 'method' => 'drawCircularArc', 'context' => $context, 'parameters' => array($this->get3dCoordinate($barCenterTop, $midDepth), $barWidth, $barWidth / 2, ($barCenterBottom->y - $barCenterTop->y) * $this->yDepthFactor, 0, 180, $color));
$this->barPostProcessing[] = array('index' => $barCenterBottom->x + 1, 'method' => 'drawCircle', 'context' => $context, 'parameters' => array($top = $this->get3dCoordinate($barCenterTop, $midDepth), $barWidth, $barWidth / 2, $symbol === ezcGraph::CIRCLE ? new ezcGraphLinearGradient(new ezcGraphCoordinate($top->x - $barWidth / 2, $top->y), new ezcGraphCoordinate($top->x + $barWidth / 2, $top->y), $color->darken($this->options->barDarkenTop), $color) : $color));
}
示例2: drawCircularArcStep
/**
* Draws a single element of a circular arc
*
* ext/gd itself does not support something like circular arcs, so that
* this functions draws rectangular polygons as a part of circular arcs
* to interpolate them. This way it is possible to apply a linear gradient
* to the circular arc, because we draw single steps anyway.
*
* @param ezcGraphCoordinate $center Center of ellipse
* @param integer $width Width of ellipse
* @param integer $height Height of ellipse
* @param integer $size Height of border
* @param float $startAngle Starting angle of circle sector
* @param float $endAngle Ending angle of circle sector
* @param ezcGraphColor $color Color of Border
* @return void
*/
protected function drawCircularArcStep(ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color)
{
$this->drawPolygon(array(new ezcGraphCoordinate($center->x + cos(deg2rad($startAngle)) * $width / 2, $center->y + sin(deg2rad($startAngle)) * $height / 2), new ezcGraphCoordinate($center->x + cos(deg2rad($startAngle)) * $width / 2, $center->y + sin(deg2rad($startAngle)) * $height / 2 + $size), new ezcGraphCoordinate($center->x + cos(deg2rad($endAngle)) * $width / 2, $center->y + sin(deg2rad($endAngle)) * $height / 2 + $size), new ezcGraphCoordinate($center->x + cos(deg2rad($endAngle)) * $width / 2, $center->y + sin(deg2rad($endAngle)) * $height / 2)), $color->darken($this->options->shadeCircularArc * (1 + cos(deg2rad($startAngle))) / 2), true);
}