More complete sentence and translator documentation added.

This commit is contained in:
Siebrand Mazeland 2010-10-20 00:53:42 +02:00
parent 0157df7396
commit 25b9552ec3

View File

@ -32,7 +32,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
} }
class WebColor { class WebColor {
// XXX: Maybe make getters and setters for r,g,b values and tuples, // XXX: Maybe make getters and setters for r,g,b values and tuples,
// e.g.: to support this kinda CSS representation: rgb(255,0,0) // e.g.: to support this kinda CSS representation: rgb(255,0,0)
// http://www.w3.org/TR/CSS21/syndata.html#color-units // http://www.w3.org/TR/CSS21/syndata.html#color-units
@ -65,7 +64,6 @@ class WebColor {
* *
* @return nothing * @return nothing
*/ */
function parseColor($color) { function parseColor($color) {
if (is_numeric($color)) { if (is_numeric($color)) {
@ -90,13 +88,11 @@ class WebColor {
* *
* @return nothing * @return nothing
*/ */
function setNamedColor($name) function setNamedColor($name)
{ {
// XXX Implement this // XXX Implement this
} }
/** /**
* Sets the RGB color values from a a hex tuple * Sets the RGB color values from a a hex tuple
* *
@ -104,7 +100,6 @@ class WebColor {
* *
* @return nothing * @return nothing
*/ */
function setHexColor($hexcolor) { function setHexColor($hexcolor) {
if ($hexcolor[0] == '#') { if ($hexcolor[0] == '#') {
@ -120,7 +115,9 @@ class WebColor {
$hexcolor[1].$hexcolor[1], $hexcolor[1].$hexcolor[1],
$hexcolor[2].$hexcolor[2]); $hexcolor[2].$hexcolor[2]);
} else { } else {
$errmsg = _('%s is not a valid color! Use 3 or 6 hex chars.'); // TRANS: Validation error for a web colour.
// TRANS: %s is the provided (invalid) text for colour.
$errmsg = _('%s is not a valid color! Use 3 or 6 hex characters.');
throw new WebColorException(sprintf($errmsg, $hexcolor)); throw new WebColorException(sprintf($errmsg, $hexcolor));
} }
@ -137,7 +134,6 @@ class WebColor {
* *
* @return nothing * @return nothing
*/ */
function setIntColor($intcolor) function setIntColor($intcolor)
{ {
// We could do 32 bit and have an alpha channel because // We could do 32 bit and have an alpha channel because
@ -154,7 +150,6 @@ class WebColor {
* *
* @return string * @return string
*/ */
function hexValue() { function hexValue() {
$hexcolor = (strlen(dechex($this->red)) < 2 ? '0' : '' ) . $hexcolor = (strlen(dechex($this->red)) < 2 ? '0' : '' ) .
@ -165,7 +160,6 @@ class WebColor {
dechex($this->blue); dechex($this->blue);
return strtoupper($hexcolor); return strtoupper($hexcolor);
} }
/** /**
@ -176,7 +170,6 @@ class WebColor {
* *
* @return int * @return int
*/ */
function intValue() function intValue()
{ {
$intcolor = 256 * 256 * $this->red + 256 * $this->green + $this->blue; $intcolor = 256 * 256 * $this->red + 256 * $this->green + $this->blue;
@ -188,5 +181,3 @@ class WebColor {
class WebColorException extends Exception class WebColorException extends Exception
{ {
} }
?>