File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -476,17 +476,15 @@ def __init__(self, renderer):
476
476
477
477
def rgb_to_gdk_color (self , rgb ):
478
478
"""
479
- Take an RGB tuple (with three 0.0-1.0 values) and return an allocated
480
- gtk.gdk.Color
479
+ rgb - an RGB tuple (three 0.0-1.0 values)
480
+ return an allocated gtk.gdk.Color
481
481
"""
482
482
try :
483
- #return self._cached[tuple(rgb)] # tuple not needed?
484
483
return self ._cached [rgb ]
485
484
except KeyError :
486
- color = self ._cmap .alloc_color (
487
- int (rgb [0 ]* 65535 ),int (rgb [1 ]* 65535 ),int (rgb [2 ]* 65535 ))
488
- #self._cached[tuple(rgb)] = color
489
- self ._cached [rgb ] = color
485
+ color = self ._cached [rgb ] = \
486
+ self ._cmap .alloc_color (
487
+ int (rgb [0 ]* 65535 ),int (rgb [1 ]* 65535 ),int (rgb [2 ]* 65535 ))
490
488
return color
491
489
492
490
You can’t perform that action at this time.
0 commit comments