GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SWF::BUILDER::GRADIENT (3)

.ds Aq ’

NAME

SWF::Builder::Gradient - SWF gradient object.

CONTENTS

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);



DESCRIPTION

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 [, $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 [Red => 255], 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.

COPYRIGHT

Copyright 2003 Yasuhiro Sasama (ySas), <ysas@nmt.ne.jp>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 SWF::BUILDER::GRADIENT (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.