Skip to content
Snippets Groups Projects
Select Git revision
  • 85588e617bcfb7e79d5b65ddd26a920ecb480ce6
  • main default protected
  • pdf-annotieren
  • pdf-annotieren-2.0
  • issue-4244
  • issues-4244-b
  • pdf-annotieren-old
  • biest-4274
  • issue-2982
  • issue-660
  • issue-3326
  • issue-3270
  • issue-3616
  • 5.1
  • 5.2
  • 5.3
  • 5.4
  • 5.5
  • issue-4255
  • issue-4261
  • issue-4262
  • v5.4.2
  • v5.3.5
  • v5.2.7
  • v5.1.8
  • v5.4.1
  • v5.3.4
  • v5.2.6
  • v5.1.7
  • v5.0.9
  • v5.4
  • v5.3.3
  • v5.2.5
  • v5.1.6
  • v5.0.8
  • v5.3.2
  • v5.2.4
  • v5.1.5
  • v5.0.7
  • v5.3.1
  • v5.2.3
41 results

RouteMap.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    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;
        }
    
        /**