SWF::Builder::Gradient

SWF gradient object
Download

SWF::Builder::Gradient Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Yasuhiro Sasama
  • Publisher web site:
  • http://search.cpan.org/~ysas/SWF-Builder-0.16/lib/SWF/Builder/Character/EditText.pm

SWF::Builder::Gradient Tags


SWF::Builder::Gradient Description

SWF gradient object SWF::Builder::Gradient is a SWF gradient object in Perl.SYNOPSIS my $gr = $mc->new_gradient; $gr->add_color( 0 => '000000', 98 => '0000ff', 128 => 'ff0000', 158 => '0000ff', 255 => '000000', ); my $gm = $gr->matrix; my $shape = $mc->new_shape ->fillstyle($gr, 'linear', $gm) ->moveto( ... ) ->lineto( ... )-> ... ; $gm->fit_to_rect(longer => $shape->get_bbox);Gradient object is a kind of fill styles of shapes. Colors are interpolated between the control points determined by ratios. Each gradient has 1-8 control points.$gr = $mc->new_gradient returns a new gradient object.$gr->add_color( $ratio, $color ) adds control points of the gradient. $ratio is a position of the point. 0 maps to left/center and 255 to right/outer for linear/radial gradient. $color can take a six or eight-figure hexadecimal string, an array reference of R, G, B, and optional alpha value, an array reference of named parameters such as , and SWF::Element::RGB/RGBA object.$gm = $gr->matrix returns a transformation matrix for the gradient.$gm->fit_to_rect( $mode => @rect ) transforms the gradient matrix to fit to the rectangle. $mode can take as follows: fit to fit the gradient square to the rectangle. It does not keep proportion. width to fit the gradient square to the width of the rectangle, and scales it with keeping proportion. height to fit the gradient square to the height of the rectangle, and scales it with keeping proportion. longer to fit the gradient square to the longer side of the rectangle, and scales it with keeping proportion. shorter to fit the gradient square to the shorter side of the rectangle, and scales it with keeping proportion. Requirements: · Perl


SWF::Builder::Gradient Related Software