cc-linear-gradient

cc-linear-gradient

Synopsis


#include <ccc.h>


typedef             CcLinearGradient;
typedef             CcLinearGradientClass;
GType               cc_linear_gradient_get_type         (void);
CcBrush*            cc_linear_gradient_new              (gdouble x1,
                                                         gdouble y1,
                                                         gdouble x2,
                                                         gdouble y2);

Object Hierarchy


  GObject
   +----GInitiallyUnowned
         +----CcBrush
               +----CcGradient
                     +----CcLinearGradient

Properties


  "x1"                       gdouble               : Read / Write
  "x2"                       gdouble               : Read / Write
  "y1"                       gdouble               : Read / Write
  "y2"                       gdouble               : Read / Write

Description

Linear gradients are a very nice pattern to fill items with. To permit gradients to be applied to different items, the API got designed a bit tricky (but still easy to understand).

Instead of working with exact coordinates on items, you specify two points for the gradient (the start and the end) relative to the item's bounding box.

A gradient from (0.0; 0.0) to (1.0; 1.0) applied to a square will result in a linear gradient from the north-western corner of the square to the south-eastern corner.

A gradient from (0.5; 0.0) to (0.5; 1.0) applied to a square will result in a gradient from the top to the bottom.

Of course, you are not limited to the bounding box of your item. A gradient like this can also be applied: (-0.25; 0.0) to (0.5; 1.0).

Details

CcLinearGradient

typedef CcGradient      CcLinearGradient;


CcLinearGradientClass

typedef CcGradientClass CcLinearGradientClass;


cc_linear_gradient_get_type ()

GType               cc_linear_gradient_get_type         (void);

Returns :

cc_linear_gradient_new ()

CcBrush*            cc_linear_gradient_new              (gdouble x1,
                                                         gdouble y1,
                                                         gdouble x2,
                                                         gdouble y2);

x1 :
y1 :
x2 :
y2 :
Returns :

Property Details

The "x1" property

  "x1"                       gdouble               : Read / Write

The first horizontal point.

Default value: 0


The "x2" property

  "x2"                       gdouble               : Read / Write

The second horizontal point.

Default value: 1


The "y1" property

  "y1"                       gdouble               : Read / Write

The first vertical point.

Default value: 0


The "y2" property

  "y2"                       gdouble               : Read / Write

The second vertical point.

Default value: 1