Module eagle :: Class Color
[hide private]
[frames] | no frames]

Class Color
source code

object --+                
         |                
 _EGObject --+            
             |            
     _EGWidget --+        
                 |        
     _EGDataWidget --+    
                     |    
      _EGWidLabelEntry --+
                         |
                        Color

Button to select colors.

It show current/last selected color and may pop-up a new dialog to select a new one.

Instance Methods [hide private]
  __init__(self, id, label="", color=0, use_alpha=False, callback=None, persistent=False, expand_policy=None)
Color selector constructor.
  __setup_gui__(self)
  __setup_connections__(self)
  get_value(self)
Return a tuple with ( alpha, red, green, blue ) ( alpha, red, green, blue ) (use_alpha=True), each in 0-255 range.
  set_value(self, value)

Inherited from _EGWidLabelEntry: __configure_orientation__, __repr__, __str__, get_label, set_label

Inherited from _EGWidget: __get_widgets__, hide, set_active, set_inactive, show

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__


Static Methods [hide private]
  color_from(color)

Class Variables [hide private]
color  
use_alpha  
callback  

Inherited from _EGWidLabelEntry: label

Inherited from _EGDataWidget: persistent

Inherited from _EGWidget: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, app

Inherited from _EGObject: id

Inherited from object: __class__


Method Details [hide private]

__init__(self, id, label="", color=0, use_alpha=False, callback=None, persistent=False, expand_policy=None)
(Constructor)

source code 
Color selector constructor.
Parameters:
  • id - unique identifier.
  • label - what to show on a label on the left side of the widget.
  • color - initial content. May be a triple with elements within the range 0-255, an string with color in HTML format or even a color present in X11's rgb.txt.
  • use_alpha - if the alpha channel should be used, it will be the first value in the tuple representing the color.
  • callback - function (or list of functions) that will be called when this widget have its data changed. Function will receive as parameters:
    • App reference
    • Widget reference
    • new value
  • persistent - if this widget should save its data between sessions.
  • expand_policy - how this widget should fit space, see ExpandPolicy.Policy.Rule.
Overrides: _EGWidLabelEntry.__init__

color_from(color)

source code 

__setup_gui__(self)

source code 
Overrides: _EGWidLabelEntry.__setup_gui__

__setup_connections__(self)

source code 

get_value(self)

source code 
Return a tuple with ( alpha, red, green, blue ) ( alpha, red, green, blue ) (use_alpha=True), each in 0-255 range.
Overrides: _EGWidLabelEntry.get_value

set_value(self, value)

source code 
Parameters:
  • value - May be a triple with elements within the range 0-255, an string with color in HTML format or even a color present in X11's rgb.txt.
Overrides: _EGWidLabelEntry.set_value

Class Variable Details [hide private]

color

Value:
_gen_ro_property("color")                                              
      

use_alpha

Value:
_gen_ro_property("use_alpha")                                          
      

callback

Value:
_gen_ro_property("callback")