summaryrefslogtreecommitdiffstats
path: root/src/structs
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-05-09 10:13:54 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-05-09 10:13:54 +0000
commit3cb117beb5bd17c6f8082717eb40467f3ddf79c8 (patch)
tree3996bfc6e77181501532d4e60c35b61835af6d43 /src/structs
parentb1a7160bf0bda45f2a2e818e09446bd53e2162c1 (diff)
downloadzetacomponents-graph-3cb117beb5bd17c6f8082717eb40467f3ddf79c8.zip
zetacomponents-graph-3cb117beb5bd17c6f8082717eb40467f3ddf79c8.tar.gz
- Added documentation to color class
- Fixed typo
Diffstat (limited to 'src/structs')
-rw-r--r--src/structs/color.php42
1 files changed, 39 insertions, 3 deletions
diff --git a/src/structs/color.php b/src/structs/color.php
index 6fa5993..c9b1617 100644
--- a/src/structs/color.php
+++ b/src/structs/color.php
@@ -1,13 +1,49 @@
<?php
+/**
+ * ezcGraphColor
+ *
+ * Struct for representing colors in ezcGraph. A color is defined using the
+ * common RGBA model with integer values between 0 and 255. An alpha value
+ * of zero means full opacity, while 255 means full transparency.
+ */
class ezcGraphColor
{
+ /**
+ * Red color value.
+ *
+ * Contains a value between 0 and 255
+ *
+ * @var integer
+ */
public $red = 0;
+ /**
+ * Green color value.
+ *
+ * Contains a value between 0 and 255
+ *
+ * @var integer
+ */
public $green = 0;
+ /**
+ * Blue color value.
+ *
+ * Contains a value between 0 and 255
+ *
+ * @var integer
+ */
public $blue = 0;
+ /**
+ * Alpha color value.
+ *
+ * Contains a value between 0 and 255. 0 means full opacity and 255 full
+ * transparency.
+ *
+ * @var integer
+ */
public $alpha = 0;
/**
@@ -55,7 +91,7 @@ class ezcGraphColor
if ( isset( $keys[$nr] ) )
{
$key = $keys[$nr];
- $color->$key = hexdec( $hexValue ) % 255;
+ $color->$key = hexdec( $hexValue ) % 256;
}
}
@@ -86,7 +122,7 @@ class ezcGraphColor
if ( isset( $keys[$nr] ) )
{
$key = $keys[$nr++];
- $color->$key = ( (int) $colorValue ) % 255;
+ $color->$key = ( (int) $colorValue ) % 256;
}
}
@@ -117,7 +153,7 @@ class ezcGraphColor
if ( isset( $keys[$nr] ) )
{
$key = $keys[$nr++];
- $color->$key = ( (float) $colorValue * 255 ) % 255;
+ $color->$key = ( (float) $colorValue * 255 ) % 256;
}
}
OpenPOWER on IntegriCloud