summaryrefslogtreecommitdiffstats
path: root/src/colors
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-09-24 10:11:12 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-09-24 10:11:12 +0000
commit7f2e4d468f356fa62ce3377143747b00ad8cd409 (patch)
tree62d355113784ad35a49d1e77ce67af3148037293 /src/colors
parenteac6feb77d1f0ab2e903bb0ab218304c0274464c (diff)
downloadzetacomponents-graph-7f2e4d468f356fa62ce3377143747b00ad8cd409.zip
zetacomponents-graph-7f2e4d468f356fa62ce3377143747b00ad8cd409.tar.gz
- Use ezcGraphColor::create for all color properties
Diffstat (limited to 'src/colors')
-rw-r--r--src/colors/linear_gradient.php18
-rw-r--r--src/colors/radial_gradient.php18
2 files changed, 4 insertions, 32 deletions
diff --git a/src/colors/linear_gradient.php b/src/colors/linear_gradient.php
index f1fe1c7..674bc24 100644
--- a/src/colors/linear_gradient.php
+++ b/src/colors/linear_gradient.php
@@ -80,24 +80,10 @@ class ezcGraphLinearGradient extends ezcGraphColor
}
break;
case 'startColor':
- if ( !$propertyValue instanceof ezcGraphColor )
- {
- throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphColor' );
- }
- else
- {
- $this->properties['startColor'] = $propertyValue;
- }
+ $this->properties['startColor'] = ezcGraphColor::create( $propertyValue );
break;
case 'endColor':
- if ( !$propertyValue instanceof ezcGraphColor )
- {
- throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphColor' );
- }
- else
- {
- $this->properties['endColor'] = $propertyValue;
- }
+ $this->properties['endColor'] = ezcGraphColor::create( $propertyValue );
break;
}
}
diff --git a/src/colors/radial_gradient.php b/src/colors/radial_gradient.php
index abc34cf..e610a65 100644
--- a/src/colors/radial_gradient.php
+++ b/src/colors/radial_gradient.php
@@ -86,24 +86,10 @@ class ezcGraphRadialGradient extends ezcGraphColor
$this->properties['offset'] = min( 0, max( 1, (float) $propertyValue ) );
break;
case 'startColor':
- if ( !$propertyValue instanceof ezcGraphColor )
- {
- throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphColor' );
- }
- else
- {
- $this->properties['startColor'] = $propertyValue;
- }
+ $this->properties['startColor'] = ezcGraphColor::create( $propertyValue );
break;
case 'endColor':
- if ( !$propertyValue instanceof ezcGraphColor )
- {
- throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphColor' );
- }
- else
- {
- $this->properties['endColor'] = $propertyValue;
- }
+ $this->properties['endColor'] = ezcGraphColor::create( $propertyValue );
break;
}
}
OpenPOWER on IntegriCloud