function _getColor($name_color = '')
    {
        $colors = array(
                        'aqua'    => 0x0F,
                        'cyan'    => 0x0F,
                        'black'   => 0x08,
                        'blue'    => 0x0C,
                        'brown'   => 0x10,
                        'magenta' => 0x0E,
                        'fuchsia' => 0x0E,
                        'gray'    => 0x17,
                        'grey'    => 0x17,
                        'green'   => 0x11,
                        'lime'    => 0x0B,
                        'navy'    => 0x12,
                        'orange'  => 0x35,
                        'purple'  => 0x14,
                        'red'     => 0x0A,
                        'silver'  => 0x16,
                        'white'   => 0x09,
                        'yellow'  => 0x0D
                       );

        // Return the default color, 0x7FFF, if undef,
        if ($name_color == '') {
            return(0x7FFF);
        }

        // or the color string converted to an integer,
        if (isset($colors[$name_color])) {
            return($colors[$name_color]);
        }

        // or the default color if string is unrecognised,
        if (preg_match("/\D/",$name_color)) {
            return(0x7FFF);
        }

        // or an index < 8 mapped into the correct range,
        if ($name_color < 8) {
            return($name_color + 8);
        }

        // or the default color if arg is outside range,
        if ($name_color > 63) {
            return(0x7FFF);
        }

        // or an integer in the valid range
        return($name_color);
    }
function _getColor($name_color = '')
    {
        $colors = array(
                        'aqua'    => 0x0F,
                        'cyan'    => 0x0F,
                        'black'   => 0x08,
                        'blue'    => 0x0C,
                        'brown'   => 0x10,
                        'magenta' => 0x0E,
                        'fuchsia' => 0x0E,
                        'gray'    => 0x17,
                        'grey'    => 0x17,
                        'green'   => 0x11,
                        'lime'    => 0x0B,
                        'navy'    => 0x12,
                        'orange'  => 0x35,
                        'purple'  => 0x14,
                        'red'     => 0x0A,
                        'silver'  => 0x16,
                        'white'   => 0x09,
                        'yellow'  => 0x0D
                       );

        // Return the default color, 0x7FFF, if undef,
        if ($name_color == '') {
            return(0x7FFF);
        }

        // or the color string converted to an integer,
        if (isset($colors[$name_color])) {
            return($colors[$name_color]);
        }

        // or the default color if string is unrecognised,
        if (preg_match("/\D/",$name_color)) {
            return(0x7FFF);
        }

        // or an index < 8 mapped into the correct range,
        if ($name_color < 8) {
            return($name_color + 8);
        }

        // or the default color if arg is outside range,
        if ($name_color > 63) {
            return(0x7FFF);
        }

        // or an integer in the valid range
        return($name_color);
    }
function _getColor ( $ name_color = '' ) { $ colors = array ( 'aqua' => 0x0F , 'cyan' => 0x0F , 'black' => 0x08 , 'blue' => 0x0C , 'brown' => 0x10 , 'magenta' => 0x0E , 'fuchsia' => 0x0E , 'gray' => 0x17 , 'grey' => 0x17 , 'green' => 0x11 , 'lime' => 0x0B , 'navy' => 0x12 , 'orange' => 0x35 , 'purple' => 0x14 , 'red' => 0x0A , 'silver' => 0x16 , 'white' => 0x09 , 'yellow' => 0x0D ) ; // Return the default color, 0x7FFF, if undef,
 if ( $ name_color == '' ) { return ( 0x7FFF ) ; } // or the color string converted to an integer,
 if ( isset ( $ colors [ $ name_color ] ) ) { return ( $ colors [ $ name_color ] ) ; } // or the default color if string is unrecognised,
 if ( preg_match ( "/\D/" , $ name_color ) ) { return ( 0x7FFF ) ; } // or an index < 8 mapped into the correct range,
 if ( $ name_color < 8 ) { return ( $ name_color + 8 ) ; } // or the default color if arg is outside range,
 if ( $ name_color > 63 ) { return ( 0x7FFF ) ; } // or an integer in the valid range
 return ( $ name_color ) ; }
Used in conjunction with the set_xxx_color methods to convert a color
string into a number. Color range is 0..63 but we will restrict it
to 8..63 to comply with Gnumeric. Colors 0..7 are repeated in 8..15.

@access private
@param string $name_color name of the color (i.e.: 'blue', 'red', etc..). Optional.
@return integer The color index
Used in conjunction with the set_xxx_color methods to convert a color string into a number . Color range is 0 .. 63 but we will restrict it to 8 .. 63 to comply with Gnumeric . Colors 0 .. 7 are repeated in 8 .. 15 .