diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-09-24 10:11:12 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-09-24 10:11:12 +0000 |
commit | 7f2e4d468f356fa62ce3377143747b00ad8cd409 (patch) | |
tree | 62d355113784ad35a49d1e77ce67af3148037293 /src/colors | |
parent | eac6feb77d1f0ab2e903bb0ab218304c0274464c (diff) | |
download | zetacomponents-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.php | 18 | ||||
-rw-r--r-- | src/colors/radial_gradient.php | 18 |
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; } } |