Table Of Contents

Previous topic

GraphicsGradientStop

Next topic

GraphicsMatrix

This Page

phoenix_title GraphicsGradientStops

Represents a collection of GraphicGradientStop values for use with CreateLinearGradientBrush and CreateRadialGradientBrush.

The stops are maintained in order of position. If two or more stops are added with the same position then the one(s) added later come later. This can be useful for producing discontinuities in the colour gradient.

Notice that this class is write-once, you can’t modify the stops once they had been added.

New in version 2.9.1.


class_hierarchy Inheritance Diagram

Inheritance diagram for class GraphicsGradientStops

Inheritance diagram of GraphicsGradientStops


method_summary Methods Summary

__init__ Initializes the gradient stops with the given boundary colours.
Add Add a new stop.
GetCount Returns the number of stops.
GetEndColour Returns the end colour.
GetStartColour Returns the start colour.
Item Returns the stop at the given index.
SetEndColour Set the end colour to col.
SetStartColour Set the start colour to col.
__getitem__  
__len__  

api Class API



class GraphicsGradientStops(object)

Represents a collection of GraphicGradientStop values for use with CreateLinearGradientBrush and CreateRadialGradientBrush.

Possible constructors:

GraphicsGradientStops(startCol=TransparentColour,
                      endCol=TransparentColour)

Methods



__init__(self, startCol=TransparentColour, endCol=TransparentColour)

Initializes the gradient stops with the given boundary colours.

Creates a GraphicsGradientStops instance with start colour given by startCol and end colour given by endCol.

Parameters:


Add(self, *args, **kw)

Add a new stop.


overload Overloaded Implementations:



Add (self, stop)

Parameters:stop (GraphicsGradientStop) –



Add (self, col, pos)

Parameters:
  • col (Colour) –
  • pos (float) –





GetCount(self)

Returns the number of stops.



GetEndColour(self)

Returns the end colour.

Return type: Colour


GetStartColour(self)

Returns the start colour.

Return type: Colour


Item(self, n)

Returns the stop at the given index.

Parameters:n – The index, must be in [0, GetCount ) range.
Return type: GraphicsGradientStop


SetEndColour(self, col)

Set the end colour to col.

Parameters:col (Colour) –


SetStartColour(self, col)

Set the start colour to col.

Parameters:col (Colour) –


__getitem__(self, n)


__len__(self)
Return type:SIP_SSIZE_T

Properties



Count

See GetCount



EndColour

See GetEndColour and SetEndColour



StartColour

See GetStartColour and SetStartColour