summaryrefslogtreecommitdiffstats
path: root/src/structs/color.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/structs/color.php')
-rw-r--r--src/structs/color.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/structs/color.php b/src/structs/color.php
index c9b1617..c95ce6c 100644
--- a/src/structs/color.php
+++ b/src/structs/color.php
@@ -197,6 +197,24 @@ class ezcGraphColor
throw new ezcGraphUnknownColorDefinitionException( $color );
}
}
+
+ /**
+ * Darkens the color
+ *
+ * @param float $value Percent to darken the color
+ * @return void
+ */
+ public function darken( $value )
+ {
+ $color = clone $this;
+
+ $value = 1 - $value;
+ $color->red *= $value;
+ $color->green *= $value;
+ $color->blue *= $value;
+
+ return $color;
+ }
}
?>
OpenPOWER on IntegriCloud