-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from duboism/port_php8
Port to PHP 8
- Loading branch information
Showing
3 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,7 +273,7 @@ function changeLightness($degree = 10) | |
* @static | ||
* @author Jason Lotito <[email protected]> | ||
*/ | ||
function getTextColor($color, $light = '#FFFFFF', $dark = '#000000') | ||
static function getTextColor($color, $light = '#FFFFFF', $dark = '#000000') | ||
{ | ||
$color = Image_Color::_splitColor($color); | ||
if ($color[1] > hexdec('66')) { | ||
|
@@ -312,7 +312,7 @@ function _setColors($col1, $col2) | |
* @static | ||
* @author Jason Lotito <[email protected]> | ||
*/ | ||
function _splitColor($color) | ||
static function _splitColor($color) | ||
{ | ||
$color = str_replace('#', '', $color); | ||
$c[] = hexdec(substr($color, 0, 2)); | ||
|
@@ -327,7 +327,7 @@ function _splitColor($color) | |
* @deprecated Function deprecated after 1.0.1 | ||
* @see rgb2hex(). | ||
*/ | ||
function _returnColor ( $color ) | ||
static function _returnColor ( $color ) | ||
{ | ||
return Image_Color::rgb2hex($color); | ||
} | ||
|
@@ -342,7 +342,7 @@ function _returnColor ( $color ) | |
* @author Jason Lotito <[email protected]> | ||
* @see hex2rgb() | ||
*/ | ||
function rgb2hex($color) | ||
static function rgb2hex($color) | ||
{ | ||
return sprintf('%02X%02X%02X',$color[0],$color[1],$color[2]); | ||
} | ||
|
@@ -359,7 +359,7 @@ function rgb2hex($color) | |
* @author Jason Lotito <[email protected]> | ||
* @see rgb2hex() | ||
*/ | ||
function hex2rgb($hex) | ||
static function hex2rgb($hex) | ||
{ | ||
$return = Image_Color::_splitColor($hex); | ||
$return['hex'] = $hex; | ||
|
@@ -379,7 +379,7 @@ function hex2rgb($hex) | |
* @uses hsv2hex() to convert the HSV value to Hex. | ||
* @uses hex2rgb() to convert the Hex value to RGB. | ||
*/ | ||
function hsv2rgb($h, $s, $v) | ||
static function hsv2rgb($h, $s, $v) | ||
{ | ||
return Image_Color::hex2rgb(Image_Color::hsv2hex($h, $s, $v)); | ||
} | ||
|
@@ -399,7 +399,7 @@ function hsv2rgb($h, $s, $v) | |
* @author Jurgen Schwietering <[email protected]> | ||
* @uses rgb2hex() to convert the return value to a hex string. | ||
*/ | ||
function hsv2hex($h, $s, $v) | ||
static function hsv2hex($h, $s, $v) | ||
{ | ||
$s /= 256.0; | ||
$v /= 256.0; | ||
|
@@ -470,7 +470,7 @@ function hsv2hex($h, $s, $v) | |
* @uses ImageColorAllocate() to allocate the color. | ||
* @uses color2RGB() to parse the color into RGB values. | ||
*/ | ||
function allocateColor(&$img, $color) { | ||
static function allocateColor(&$img, $color) { | ||
$color = Image_Color::color2RGB($color); | ||
|
||
return ImageColorAllocate($img, $color[0], $color[1], $color[2]); | ||
|
@@ -490,11 +490,11 @@ function allocateColor(&$img, $color) { | |
* @uses hex2rgb() to convert colors begining with the # character. | ||
* @uses namedColor2RGB() to convert everything not starting with a #. | ||
*/ | ||
function color2RGB($color) | ||
static function color2RGB($color) | ||
{ | ||
$c = array(); | ||
|
||
if ($color{0} == '#') { | ||
if ($color[0] == '#') { | ||
$c = Image_Color::hex2rgb($color); | ||
} else { | ||
$c = Image_Color::namedColor2RGB($color); | ||
|
@@ -514,7 +514,7 @@ function color2RGB($color) | |
* @static | ||
* @author Sebastian Bergmann <[email protected]> | ||
*/ | ||
function namedColor2RGB($color) | ||
static function namedColor2RGB($color) | ||
{ | ||
static $colornames; | ||
|
||
|
@@ -680,7 +680,7 @@ function namedColor2RGB($color) | |
* @access public | ||
* @static | ||
*/ | ||
function percentageColor2RGB($color) | ||
static function percentageColor2RGB($color) | ||
{ | ||
// remove spaces | ||
$color = str_replace(' ', '', $color); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters