Lines Matching refs:stops

154 	// $stops = array('col'=>$col [, 'opacity'=>0-1] [, 'offset'=>0-1])
155 public function Gradient($x, $y, $w, $h, $type, $stops = [], $colorspace = 'RGB', $coords = '', $extend = '', $return = false, $is_mask = false)
492 if (count($stops) == 1) {
493 $stops[1] = $stops[0];
495 if (!isset($stops[0]['offset'])) {
496 $stops[0]['offset'] = 0;
498 if (!isset($stops[count($stops) - 1]['offset'])) {
499 $stops[count($stops) - 1]['offset'] = 1;
511 for ($i = 0; $i < count($stops); $i++) {
512 if (isset($stops[$i]['offset']) && preg_match('/([0-9.]+(px|em|ex|pc|pt|cm|mm|in))/i', $stops[$i]['offset'], $m)) {
514 $stops[$i]['offset'] = $axis_length ? $tmp / $axis_length : 0;
519 if (isset($stops[0]['offset']) && $stops[0]['offset'] > 0) {
520 $firststop = $stops[0];
522 array_unshift($stops, $firststop);
524 if (!$repeat && isset($stops[count($stops) - 1]['offset']) && $stops[count($stops) - 1]['offset'] < 1) {
525 $endstop = $stops[count($stops) - 1];
527 $stops[] = $endstop;
529 if ($stops[0]['offset'] > $stops[count($stops) - 1]['offset']) {
530 $stops[0]['offset'] = 0;
531 $stops[count($stops) - 1]['offset'] = 1;
534 for ($i = 0; $i < count($stops); $i++) {
537 $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F %.3F', ord($stops[$i]['col'][1]) / 100, ord($stops[$i]['col'][2]) / 100, ord($stops[$i]['col'][3]) / 100, ord($stops[$i]['col'][4]) / 100);
539 $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F', ord($stops[$i]['col'][1]) / 255);
541 $this->mpdf->gradients[$n]['stops'][$i]['col'] = sprintf('%.3F %.3F %.3F', ord($stops[$i]['col'][1]) / 255, ord($stops[$i]['col'][2]) / 255, ord($stops[$i]['col'][3]) / 255);
543 if (!isset($stops[$i]['opacity'])) {
544 $stops[$i]['opacity'] = 1;
545 } elseif ($stops[$i]['opacity'] > 1 || $stops[$i]['opacity'] < 0) {
546 $stops[$i]['opacity'] = 1;
547 } elseif ($stops[$i]['opacity'] < 1) {
550 $this->mpdf->gradients[$n]['stops'][$i]['opacity'] = $stops[$i]['opacity'];
552 if ($i > 0 && $i < (count($stops) - 1)) {
553 if (!isset($stops[$i]['offset']) || (isset($stops[$i + 1]['offset']) && $stops[$i]['offset'] > $stops[$i + 1]['offset']) || $stops[$i]['offset'] < $stops[$i - 1]['offset']) {
554 if (isset($stops[$i - 1]['offset']) && isset($stops[$i + 1]['offset'])) {
555 $stops[$i]['offset'] = ($stops[$i - 1]['offset'] + $stops[$i + 1]['offset']) / 2;
557 for ($j = ($i + 1); $j < count($stops); $j++) {
558 if (isset($stops[$j]['offset'])) {
562 $int = ($stops[$j]['offset'] - $stops[$i - 1]['offset']) / ($j - $i + 1);
564 $stops[$i + $f]['offset'] = $stops[$i + $f - 1]['offset'] + $int;
569 $this->mpdf->gradients[$n]['stops'][$i]['offset'] = $stops[$i]['offset'];
573 $ns = count($this->mpdf->gradients[$n]['stops']);
576 $offs[$i] = $this->mpdf->gradients[$n]['stops'][$i]['offset'];
583 $this->mpdf->gradients[$n]['stops'][($ns * $gp) + $i] = $this->mpdf->gradients[$n]['stops'][($ns * ($gp - 1)) + $i];
584 $tmp = $this->mpdf->gradients[$n]['stops'][($ns * ($gp - 1)) + ($ns - 1)]['offset'] + $offs[$i];
586 $this->mpdf->gradients[$n]['stops'][($ns * $gp) + $i]['offset'] = $tmp;
588 $this->mpdf->gradients[$n]['stops'][($ns * $gp) + $i]['offset'] = 1;
723 $g['stops'] = [];
725 // parse stops
738 $g['stops'][] = $this->getStop($col, $el, true);
867 $g['stops'] = [];
869 // parse stops
881 $g['stops'][] = $this->getStop($col, $el);
932 if (count($g['stops'])) {
937 if (count($g['stops'])) {
987 $g['stops'] = [['col' => $g['col'], 'opacity' => 1, 'offset' => 0], ['col' => $g['col2'], 'opacity' => 1, 'offset' => 1]];