Select Git revision
RouteMap.php
Forked from
Stud.IP / Stud.IP
Source project has a limited visibility.
-
introduce datepicker/datetimepicker 'disable_holidays: true' to disable holidays in the calendar, fixes #2267 Closes #2267 Merge request studip/studip!1632
introduce datepicker/datetimepicker 'disable_holidays: true' to disable holidays in the calendar, fixes #2267 Closes #2267 Merge request studip/studip!1632
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Color.class.php 12.36 KiB
<?php
/**
* lib/classes/Color.class.php - class to mix colors and convert them between different types
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* @author Rasmus Fuhse <fuhse@data-quest.de>
* @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
* @category Stud.IP
*/
/**
* class to mix colors and convert them between different types
*
* @since 2.1
*/
class Color {
/**
* HTML-4-Standard color-names plus a few additions
* May be expanded in a later version to allow
* X11 color names as described in
* http://en.wikipedia.org/wiki/Web_colors
*
* @var array
*/
static $colorstrings = [
'aqua' => [0, 255, 255, 1],
'azure' => [240, 255, 255, 1],
'blue' => [0, 0, 255, 1],
'cyan' => [0, 255, 255, 1],
'darkblue' => [0, 0, 139, 1],
'darkred' => [139, 0, 0, 1],
'gold' => [255, 215, 0, 1],
'gray' => [128, 128, 128, 1],
'indigo' => [75, 0, 130, 1],
'lightsteelblue' => [176, 196, 222, 1],
'lightyellow' => [255, 255, 224, 1],
'lime' => [0, 255, 0, 1],
'magenta' => [255, 0, 255, 1],
'navy' => [0, 0, 128, 1],
'olive' => [128, 128, 0, 1],
'orange' => [255, 165, 0, 1],
'pink' => [255, 192, 203, 1],
'red' => [255, 0, 0, 1],
'purple' => [128, 0, 128, 1],
'violet' => [238, 130, 238, 1],
'yellow' => [255, 255, 0, 1],
'black' => [0, 0, 0, 1],
'white' => [255, 255, 255, 1]
];
/**
* converts a css-hex-color into a rgba-quadruple
*
* @param string $color the color to be converted
* @return array colors as rgba-quadruple
*/
static function hex2array($color) {
$color = str_replace('#','',$color);
$arr[0] = hexdec(mb_substr($color,0,2));
$arr[1] = hexdec(mb_substr($color,2,2));
$arr[2] = hexdec(mb_substr($color,4,2));
$arr[3] = 1.0;
return $arr;
}
/**