« Taffeta/Graphics/Role/SVGRenderable.pm
↑ Summary
Taffeta/Graphics/Role/SVGRenderable/Transform.pm »
| 1 | use Renard::Incunabula::Common::Setup; | ||
| 2 | package Intertangle::Taffeta::Graphics::Role::SVGRenderable::Style; | ||
| 3 | # ABSTRACT: Role for style SVG parameters | ||
| 4 | $Intertangle::Taffeta::Graphics::Role::SVGRenderable::Style::VERSION = '0.001'; | ||
| 5 | use Moo::Role; | ||
| 6 | |||
| 7 | requires 'fill'; | ||
| 8 | requires 'stroke'; | ||
| 9 | |||
| 10 | method svg_style_parameter() { | ||
| 11 | my $style = {}; | ||
| 12 | |||
| 13 | if( $self->has_fill ) { | ||
| 14 | $style = { %$style, %{ $self->fill->svg_style } }; | ||
| 15 | } | ||
| 16 | |||
| 17 | if( $self->has_stroke ) { | ||
| 18 | $style = { %$style, %{ $self->stroke->svg_style } }; | ||
| 19 | } | ||
| 20 | |||
| 21 | return ( style => $style ); | ||
| 22 | } | ||
| 23 | |||
| 24 | 1; | ||
| 25 | |||
| 26 | __END__ |