[ticket/10763] Fix static calls to non static methods in colour_manager

PHPBB3-10763
This commit is contained in:
Joas Schilling 2014-03-09 21:42:59 +01:00
parent 12dc36903e
commit 38aef98a69

View file

@ -2226,8 +2226,8 @@ class colour_manager
return $this->random_colour($colour, $mode); return $this->random_colour($colour, $mode);
} }
$rgb = colour_manager::model_convert($colour, $mode, 'rgb'); $rgb = $this->model_convert($colour, $mode, 'rgb');
$store = ($this->mode == 'rgb') ? $rgb : colour_manager::model_convert($colour, $mode, $this->mode); $store = ($this->mode == 'rgb') ? $rgb : $this->model_convert($colour, $mode, $this->mode);
$resource = imagecolorallocate($this->img, $rgb[0], $rgb[1], $rgb[2]); $resource = imagecolorallocate($this->img, $rgb[0], $rgb[1], $rgb[2]);
$this->colours[$resource] = $store; $this->colours[$resource] = $store;
@ -2345,7 +2345,7 @@ class colour_manager
$resource = $pre; $resource = $pre;
} }
$colour = colour_manager::model_convert($this->colours[$resource], $this->mode, $mode); $colour = $this->model_convert($this->colours[$resource], $this->mode, $mode);
$results = ($include_original) ? array($resource) : array(); $results = ($include_original) ? array($resource) : array();
$colour2 = $colour3 = $colour4 = $colour; $colour2 = $colour3 = $colour4 = $colour;
$colour2[0] += 150; $colour2[0] += 150;
@ -2380,7 +2380,7 @@ class colour_manager
$resource = $pre; $resource = $pre;
} }
$colour = colour_manager::model_convert($this->colours[$resource], $this->mode, $mode); $colour = $this->model_convert($this->colours[$resource], $this->mode, $mode);
$results = array(); $results = array();
if ($include_original) if ($include_original)
@ -2418,11 +2418,11 @@ class colour_manager
switch ($from_model) switch ($from_model)
{ {
case 'ahsv': case 'ahsv':
return colour_manager::ah2h($colour); return $this->ah2h($colour);
break; break;
case 'rgb': case 'rgb':
return colour_manager::rgb2hsv($colour); return $this->rgb2hsv($colour);
break; break;
} }
break; break;
@ -2432,11 +2432,11 @@ class colour_manager
switch ($from_model) switch ($from_model)
{ {
case 'hsv': case 'hsv':
return colour_manager::h2ah($colour); return $this->h2ah($colour);
break; break;
case 'rgb': case 'rgb':
return colour_manager::h2ah(colour_manager::rgb2hsv($colour)); return $this->h2ah($this->rgb2hsv($colour));
break; break;
} }
break; break;
@ -2445,11 +2445,11 @@ class colour_manager
switch ($from_model) switch ($from_model)
{ {
case 'hsv': case 'hsv':
return colour_manager::hsv2rgb($colour); return $this->hsv2rgb($colour);
break; break;
case 'ahsv': case 'ahsv':
return colour_manager::hsv2rgb(colour_manager::ah2h($colour)); return $this->hsv2rgb($this->ah2h($colour));
break; break;
} }
break; break;
@ -2462,7 +2462,7 @@ class colour_manager
*/ */
function hsv2rgb($hsv) function hsv2rgb($hsv)
{ {
colour_manager::normalize_hue($hsv[0]); $this->normalize_hue($hsv[0]);
$h = $hsv[0]; $h = $hsv[0];
$s = min(1, max(0, $hsv[1] / 100)); $s = min(1, max(0, $hsv[1] / 100));
@ -2554,7 +2554,7 @@ class colour_manager
break; break;
} }
} }
colour_manager::normalize_hue($h); $this->normalize_hue($h);
return array($h, $s * 100, $v * 100); return array($h, $s * 100, $v * 100);
} }
@ -2578,10 +2578,10 @@ class colour_manager
{ {
if (is_array($ahue)) if (is_array($ahue))
{ {
$ahue[0] = colour_manager::ah2h($ahue[0]); $ahue[0] = $this->ah2h($ahue[0]);
return $ahue; return $ahue;
} }
colour_manager::normalize_hue($ahue); $this->normalize_hue($ahue);
// blue through red is already ok // blue through red is already ok
if ($ahue >= 240) if ($ahue >= 240)
@ -2612,10 +2612,10 @@ class colour_manager
{ {
if (is_array($hue)) if (is_array($hue))
{ {
$hue[0] = colour_manager::h2ah($hue[0]); $hue[0] = $this->h2ah($hue[0]);
return $hue; return $hue;
} }
colour_manager::normalize_hue($hue); $this->normalize_hue($hue);
// blue through red is already ok // blue through red is already ok
if ($hue >= 240) if ($hue >= 240)