예제 #1
0
파일: color.py 프로젝트: yohell/msaview
 def get_value(self):
     if self.frompreset:
         gradient = Setting.get_value(self)
     else:
         gradient = Gradient()
     gradient.add_colorstops(*self.get_specified())
     if self.name:
         gradient.frompreset = self.name
     return gradient
예제 #2
0
파일: color.py 프로젝트: yohell/msaview
 def get_value(self):
     mappings = []
     if self.frompreset:
         mappings = Setting.get_value(self).items()
     mappings.extend(self.get_specified())
     colormap = self.colormap_class(mappings)
     if self.name:
         colormap.frompreset = self.name
     return colormap
예제 #3
0
파일: color.py 프로젝트: yohell/msaview
 def encode(self, element):
     Setting.encode(self, element)
     if self.value and not self.frompreset:
         element.attrib['color'] = self.value