<?xml version="1.0"?><phpdoc><class name="Bs_ColorCodes" extends="Bs_Object" undoc="false" access="public" package="gfx"><file>C:/usr/local/lib/php/blueshoes-4.2/core/gfx/Bs_ColorCodes.class.php</file><doc><author>andrej arn &amp;lt;andrej at blueshoes dot org&amp;gt;</author><inherited src="Array"/><description>much of the following text comes from:http://www.w3schools.com/html/html_colors.asp[CSS] colors are defined using a hexadecimal notation for thecombination of Red, Green, and Blue color values (RGB). Thelowest value that can be given to one light source is 0 (hex #00).The highest value is 255 (hex #FF).A collection of color names are supported by newer versions of bothNetscape and Internet Explorer (and others).Note: Color names are not supported by the W3C standards. If you wantto write correct CSS you should use the Color HEX values.(as i read on http://www.w3.org/TR/REC-html40/types.html in thesection &amp;quot;6.5 Colors&amp;quot;, the w3c supports 16 color names.)Web Safe ColorsA few years ago, when most computers supported only 256 different colors,a list of 216 Web Safe Colors was suggested as a Web standard. The reasonfor this was that Microsoft and Mac operating system used 40 different&amp;quot;reserved&amp;quot; fixed system colors (about 20 each).the case of hex numbers does not matter. FFFFFF and ffffff are both correct.by using hex color codes, you can produce more than 16 mio different colors.nowadays most monitors can handle that, altough some are still limited to16384 (or even 256).Black = &amp;quot;#000000&amp;quot;  Green = &amp;quot;#008000&amp;quot;Silver = &amp;quot;#C0C0C0&amp;quot;  Lime = &amp;quot;#00FF00&amp;quot;Gray = &amp;quot;#808080&amp;quot;  Olive = &amp;quot;#808000&amp;quot;White = &amp;quot;#FFFFFF&amp;quot;  Yellow = &amp;quot;#FFFF00&amp;quot;Maroon = &amp;quot;#800000&amp;quot;  Navy = &amp;quot;#000080&amp;quot;Red = &amp;quot;#FF0000&amp;quot;  Blue = &amp;quot;#0000FF&amp;quot;Purple = &amp;quot;#800080&amp;quot;  Teal = &amp;quot;#008080&amp;quot;Fuchsia = &amp;quot;#FF00FF&amp;quot;  Aqua = &amp;quot;#00FFFF&amp;quot;aqua black blue fuchsia green graylime maroon navy olive purple redsilver teal white yellow(defined in html 3.2)http://www.htmlgoodies.com/tutors/colors.htmldependencies: none</description><shortdescription>ColorCodes class.</shortdescription><version>4.0.$id$</version><since>bs4.2</since><copyright>blueshoes.org</copyright></doc><function name="Bs_ColorCodes" undoc="false" access="public"><doc><return type="void"/><description/><shortdescription>constructor</shortdescription></doc></function><function name="hexToRgb" undoc="false" access="public"><doc><parameter name="$hex" type="string">(eg FFFFFF)&#x0a;return  array (vector with 3 elements)</parameter><return type="void"/><description/><shortdescription>converts a hex value to an rgb value.</shortdescription></doc></function><function name="rgbToHex" undoc="false" access="public"><doc><parameter name="$rgb" type="array">(vector with 3 elements)</parameter><return name="" type="string"> (eg FFFFFF)</return><description/><shortdescription>converts an rgb value to a hex value.</shortdescription></doc></function><function name="nameToHex" undoc="false" access="public"><doc><parameter name="$colorName" type="string"/><return name="" type="string"> (eg FFFFFF)</return><throws>bool FALSE (if the name is unknown)</throws><description>the color name from ie/ns are known (check the kb).note: 1) &amp;quot;Aqua&amp;quot; and &amp;quot;Cyan&amp;quot; produce the same color: 00FFFF2) &amp;quot;Fuchsia&amp;quot; and &amp;quot;Magenta&amp;quot; produce the same color: FF00FF3) &amp;quot;Gray&amp;quot; and &amp;quot;Grey&amp;quot; are both correct english (is one ukand one us?) but browsers only know the &amp;quot;Gray&amp;quot; version.so here it&amp;apos;s the same.</description><shortdescription>converts a color name to its hex color code.</shortdescription></doc></function><function name="isDark" undoc="false" access="public"><doc><parameter name="$colorCode" type="string">(hex, like &amp;apos;FFFFFF&amp;apos;)</parameter><return name="" type="bool"> (TRUE=dark, FALSE=light)</return><description>this can be used to define a foreground color on a givenbackground color. on dark bg&amp;apos;s you need light foregroundcolors etc.some colors are somewhere in between. then it doesn&amp;apos;treally matter.the logic: (well check the source)</description><shortdescription>tells if a color is dark or light.</shortdescription></doc></function><function name="getWebSafe" undoc="false" access="public"><doc><return name="" type="array"> (vector)</return><description/><shortdescription>returns an array with the 216 websafe colors.</shortdescription></doc></function><function name="makeWebSafe" undoc="false" access="public"><doc><parameter name="$colorCode" type="string">(hex, like &amp;apos;FFFFFF&amp;apos;)</parameter><return name="" type="string"> (hex code)</return><description/><shortdescription/></doc></function><function name="isGray" undoc="false" access="public"><doc><parameter name="$colorCode" type="string">(hex, like &amp;apos;FFFFFF&amp;apos;)</parameter><return name="" type="bool"/><description>(uncluding) black and white.a color is gray if the red, green and blue values all are the same(you take the same amount of each color).examples: darkgray is A9A9A9black    is 000000white    is FFFFFF</description><shortdescription>tells if the color specified is gray, that means somewhere between</shortdescription></doc></function><function name="toGray" undoc="false" access="public"><doc><parameter name="$colorCode" type="string">(hex, like &amp;apos;FFFFFF&amp;apos;)</parameter><return name="" type="string"> (hex color code)</return><description>works, but could do better. the light thing is not perfect. check the source.</description><shortdescription>converts a color to a gray scale color.</shortdescription></doc></function><function name="dumpWebSafe" undoc="false" access="public"><doc><return name="" type="string"/><description>with all the 216 websafe colors in it.</description><shortdescription>returns rendered html code that displays an html table</shortdescription></doc></function><function name="isWebSafe" undoc="false" access="private"><doc><parameter name="$colorCode" type="string">(hex, like &amp;apos;FFFFFF&amp;apos;)</parameter><return name="" type="bool"/><description/><shortdescription>tells if the given color is websafe or not.</shortdescription></doc></function><function name="_cleanCode" undoc="false" access="private"><doc><parameter name="$colorCode" type="string"/><return name="" type="string"> (hex color code)</return><description>the user may send us something like #ffffff, butwhat we want is FFFFFF, so uppercase and 6 chars.</description><shortdescription>cleans a color code.</shortdescription></doc></function><function name="_createWebSafe" undoc="false" access="private"><doc><return type="void"/><description>already been done before.</description><shortdescription>inits the static var $this-&amp;gt;_webSafe if it has not</shortdescription></doc></function><function name="_createNamedColors" undoc="false" access="private"><doc><return type="void"/><description>already been done before.</description><shortdescription>inits the static var $this-&amp;gt;_namedColors if it has not</shortdescription></doc></function><variable name="$_webSafe" access="private" type="array"><doc><description/><shortdescription/></doc></variable><variable name="$_namedColors" access="private" type="array"><doc><description/><shortdescription/></doc></variable><variable name="$this" access="private" type="unknown"><doc></doc></variable><constant name="BS_COLORCODES_VERSION" undoc="true" access="private" case="default: case sensitive">4.0.$x$<doc></doc></constant><inherited src="Bs_Object" type="functions"><element>isex</element><element>isexception</element><element>tostring</element><element>tohtml</element><element>persist</element><element>unpersist</element><element>bs_object</element><element>bbsetoutput</element><element>bbawake</element><element>bbisawake</element><element>bbxmsg</element><element>bbxfunctionstart</element><element>bbxfunctionend</element><element>bbxecho</element><element>bbxvar</element><element>bbxvardump</element><element>bbforcetrace</element><element>bbbufferstart</element><element>bbbufferget</element><element>bbbufferendflush</element><element>bbbufferendclean</element></inherited><inherited src="Bs_Object" type="consts"><element>bs_object_version</element></inherited><path><parent>Bs_Object</parent></path><baseclass>Bs_Object</baseclass></class></phpdoc>