.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2025 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.GraphicsGradientStops:

==========================================================================================================================================
|phoenix_title|  **wx.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. 








         



.. versionadded:: 2.9.1 
     







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div class="collabsible-wrapper">
      <input id="collapsible-inheritance" class="collapsible-checkbox" type="checkbox">
      <label for="collapsible-inheritance" tabindex="0" title="Show inheritance diagram" class="collapsible-label">Inheritance diagram for class <strong>GraphicsGradientStops</strong>:</label>
      <div class="collapsible-content">
         <p class="graphviz">
            <center><img src="_static/images/inheritance/wx.GraphicsGradientStops_inheritance.svg" alt="Inheritance diagram of GraphicsGradientStops" usemap="#dummy" class="inheritance invert-in-dark-mode"/></center>
            <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.GraphicsGradientStops.html" title="Represents a collection of GraphicGradientStop values for use with CreateLinearGradientBrush and CreateRadialGradientBrush." alt="" coords="5,5,224,34"/> </map> 
         </p>
      </div>
   </div>
   <script type="text/javascript" src="_static/inheritancetoggle.js"></script>



|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.GraphicsGradientStops.__init__`                                       Initializes the gradient stops with the given boundary colours.
:meth:`~wx.GraphicsGradientStops.Add`                                            Add a new stop.
:meth:`~wx.GraphicsGradientStops.GetCount`                                       
:meth:`~wx.GraphicsGradientStops.GetEndColour`                                   
:meth:`~wx.GraphicsGradientStops.GetStartColour`                                 
:meth:`~wx.GraphicsGradientStops.Item`                                           
:meth:`~wx.GraphicsGradientStops.SetEndColour`                                   Set the end colour to `col`.
:meth:`~wx.GraphicsGradientStops.SetStartColour`                                 Set the start colour to `col`.
:meth:`~wx.GraphicsGradientStops.__getitem__`                                    
:meth:`~wx.GraphicsGradientStops.__len__`                                        
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.GraphicsGradientStops.Count`                                          See :meth:`~wx.GraphicsGradientStops.GetCount`
:attr:`~wx.GraphicsGradientStops.EndColour`                                      See :meth:`~wx.GraphicsGradientStops.GetEndColour` and :meth:`~wx.GraphicsGradientStops.SetEndColour`
:attr:`~wx.GraphicsGradientStops.StartColour`                                    See :meth:`~wx.GraphicsGradientStops.GetStartColour` and :meth:`~wx.GraphicsGradientStops.SetStartColour`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.GraphicsGradientStops(object)

   **Possible constructors**::

       GraphicsGradientStops(startCol=TransparentColour,
                             endCol=TransparentColour) -> None
       
   
   Represents a collection of GraphicGradientStop values for use with
   CreateLinearGradientBrush and CreateRadialGradientBrush.



   .. method:: __init__(self, startCol=TransparentColour, endCol=TransparentColour)

      Initializes the gradient stops with the given boundary colours. 
                 

      Creates a :ref:`wx.GraphicsGradientStops`  instance with start colour given by `startCol`  and end colour given by `endCol`. 
                 


      :param `startCol`: 
      :type `startCol`: wx.Colour
      :param `endCol`: 
      :type `endCol`: wx.Colour




      :rtype: `None`     








   .. method:: Add(self, *args, **kw)

      Add a new stop. 
                  


      |overload| **Overloaded Implementations:**

      :html:`<hr class="overloadsep" /><br />`

      
      **Add** `(self, stop)`
      
      
      
      
      :param `stop`: 
      :type `stop`: wx.GraphicsGradientStop
      
      
      
      
      :rtype: `None`     
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **Add** `(self, col, pos)`
      
      
      
      
      :param `col`: 
      :type `col`: wx.Colour
      :param `pos`: 
      :type `pos`: float
      
      
      
      
      :rtype: `None`     
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: GetCount(self)




                

      :rtype: `int`







      :returns: 

         The number of stops.   








   .. method:: GetEndColour(self)




                

      :rtype: :ref:`wx.Colour`







      :returns: 

         The end colour.   








   .. method:: GetStartColour(self)




                

      :rtype: :ref:`wx.Colour`







      :returns: 

         The start colour.   








   .. method:: Item(self, n)






      :param `n`: The index, must be in ``[0``, :meth:`GetCount` ) range.   






      :rtype: :ref:`wx.GraphicsGradientStop`




                  



      :returns: 

         The stop at the given index.  








   .. method:: SetEndColour(self, col)

      Set the end colour to `col`. 
                 


      :param `col`: 
      :type `col`: wx.Colour




      :rtype: `None`     








   .. method:: SetStartColour(self, col)

      Set the start colour to `col`. 
                 


      :param `col`: 
      :type `col`: wx.Colour




      :rtype: `None`     








   .. method:: __getitem__(self, n)



      :rtype: :ref:`wx.GraphicsGradientStop`








   .. method:: __len__(self)



      :rtype: `int`








   .. attribute:: Count

      See :meth:`~wx.GraphicsGradientStops.GetCount`


   .. attribute:: EndColour

      See :meth:`~wx.GraphicsGradientStops.GetEndColour` and :meth:`~wx.GraphicsGradientStops.SetEndColour`


   .. attribute:: StartColour

      See :meth:`~wx.GraphicsGradientStops.GetStartColour` and :meth:`~wx.GraphicsGradientStops.SetStartColour`

