Code color column to properly show wrapper color
This commit is contained in:
@@ -25,14 +25,14 @@ from service.const import Color
|
|||||||
|
|
||||||
# In HSL format
|
# In HSL format
|
||||||
BASE_COLORS = OrderedDict([
|
BASE_COLORS = OrderedDict([
|
||||||
(Color.red, (0 / 360.0, 1.0, 0.5, 'color_red')),
|
(Color.red, ((0 / 360.0, 1.0, 0.5), 'color_red')),
|
||||||
(Color.green, (120 / 360.0, 1.0, 0.5, 'color_green')),
|
(Color.green, ((120 / 360.0, 1.0, 0.5), 'color_green')),
|
||||||
(Color.blue, (240 / 360.0, 1.0, 0.5, 'color_blue')),
|
(Color.blue, ((240 / 360.0, 1.0, 0.5), 'color_blue')),
|
||||||
(Color.yellow, (56 / 360.0, 1.0, 0.5, 'color_yellow')),
|
(Color.yellow, ((56 / 360.0, 1.0, 0.5), 'color_yellow')),
|
||||||
(Color.cyan, (180 / 360.0, 1.0, 0.5, 'color_cyan')),
|
(Color.cyan, ((180 / 360.0, 1.0, 0.5), 'color_cyan')),
|
||||||
(Color.magenta, (300 / 360.0, 1.0, 0.5, 'color_magenta')),
|
(Color.magenta, ((300 / 360.0, 1.0, 0.5), 'color_magenta')),
|
||||||
(Color.orange, (40 / 360.0, 1.0, 0.5, 'color_orange')),
|
(Color.orange, ((40 / 360.0, 1.0, 0.5), 'color_orange')),
|
||||||
(Color.purple, (275 / 360.0, 1.0, 0.5, 'color_purple'))])
|
(Color.purple, ((275 / 360.0, 1.0, 0.5), 'color_purple'))])
|
||||||
|
|
||||||
|
|
||||||
def hsl_to_hsv(hsl):
|
def hsl_to_hsv(hsl):
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
# noinspection PyPackageRequirements
|
# noinspection PyPackageRequirements
|
||||||
import wx
|
import wx
|
||||||
|
|
||||||
|
from graphs.colors import BASE_COLORS
|
||||||
from graphs.wrapper import SourceWrapper
|
from graphs.wrapper import SourceWrapper
|
||||||
from gui.viewColumn import ViewColumn
|
from gui.viewColumn import ViewColumn
|
||||||
|
|
||||||
@@ -36,8 +37,14 @@ class LineColor(ViewColumn):
|
|||||||
self.mask = wx.LIST_MASK_TEXT
|
self.mask = wx.LIST_MASK_TEXT
|
||||||
|
|
||||||
def getImageId(self, stuff):
|
def getImageId(self, stuff):
|
||||||
red = self.fittingView.imageList.GetImageIndex('color_red', 'gui')
|
if isinstance(stuff, SourceWrapper):
|
||||||
return red
|
try:
|
||||||
|
color_data = BASE_COLORS[stuff.color]
|
||||||
|
except KeyError:
|
||||||
|
return -1
|
||||||
|
img = self.fittingView.imageList.GetImageIndex(color_data[1], 'gui')
|
||||||
|
return img
|
||||||
|
return -1
|
||||||
|
|
||||||
def getToolTip(self, stuff):
|
def getToolTip(self, stuff):
|
||||||
if isinstance(stuff, SourceWrapper):
|
if isinstance(stuff, SourceWrapper):
|
||||||
|
|||||||
Reference in New Issue
Block a user