mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-30 17:58:39 +00:00
Add rgb to int function
This commit is contained in:
parent
420a824665
commit
b9ffdc677a
|
|
@ -46,4 +46,22 @@ class ColorUtils
|
||||||
|
|
||||||
return $rgb;
|
return $rgb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert rgb to int
|
||||||
|
*
|
||||||
|
* @param array $rgb Int rgb array
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public static function rgbToInt(array $rgb) : int
|
||||||
|
{
|
||||||
|
$i = (255 & $rgb['r']) << 16;
|
||||||
|
$i += (255 & $rgb['g']) << 8;
|
||||||
|
$i += (255 & $rgb['b']);
|
||||||
|
|
||||||
|
return $i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user