Ejemplo n.º 1
0
    def setColor(self, skinNode):
        try:
            if config.plugins.MyMetrix.Color.Selection.value == 'CUSTOM':
                _selection = getHexColor(config.plugins.MyMetrix.Color.Selection_Custom.value, config.plugins.MyMetrix.Color.SelectionTransparency.value)
            else:
                _selection = config.plugins.MyMetrix.Color.Selection.value.replace('#00', '#' + str(hex(int(config.plugins.MyMetrix.Color.SelectionTransparency.value))))
            if config.plugins.MyMetrix.Color.Background2.value == 'CUSTOM':
                _background2 = getHexColor(config.plugins.MyMetrix.Color.Background2_Custom.value, config.plugins.MyMetrix.Color.BackgroundTransparency.value)
            else:
                _background2 = config.plugins.MyMetrix.Color.Background2.value.replace('#00', '#' + getHex(config.plugins.MyMetrix.Color.BackgroundTransparency.value))
            if config.plugins.MyMetrix.Color.Background.value == 'CUSTOM':
                _background = getHexColor(config.plugins.MyMetrix.Color.Background_Custom.value, config.plugins.MyMetrix.Color.BackgroundTransparency.value)
            else:
                _background = config.plugins.MyMetrix.Color.Background.value.replace('#00', '#' + getHex(config.plugins.MyMetrix.Color.BackgroundTransparency.value))
            if config.plugins.MyMetrix.Color.BackgroundText.value == 'CUSTOM':
                _BackgroundText = getHexColor(config.plugins.MyMetrix.Color.BackgroundText_Custom.value, config.plugins.MyMetrix.Color.BackgroundTextTransparency.value)
            else:
                _BackgroundText = config.plugins.MyMetrix.Color.BackgroundText.value.replace('#00', '#' + getHex(config.plugins.MyMetrix.Color.BackgroundTextTransparency.value))
            if config.plugins.MyMetrix.Color.Foreground.value == 'CUSTOM':
                _Foreground = getHexColor(config.plugins.MyMetrix.Color.Foreground_Custom.value)
            else:
                _Foreground = config.plugins.MyMetrix.Color.Foreground.value
            if config.plugins.MyMetrix.Color.Accent1.value == 'CUSTOM':
                _Accent1 = getHexColor(config.plugins.MyMetrix.Color.Accent1_Custom.value)
            else:
                _Accent1 = config.plugins.MyMetrix.Color.Accent1.value
            if config.plugins.MyMetrix.Color.Accent2.value == 'CUSTOM':
                _Accent2 = getHexColor(config.plugins.MyMetrix.Color.Accent2_Custom.value)
            else:
                _Accent2 = config.plugins.MyMetrix.Color.Accent2.value
            if config.plugins.MyMetrix.Color.Background.value == 'CUSTOM':
                _transparent = getHexColor(config.plugins.MyMetrix.Color.Background_Custom.value, 255)
            else:
                _transparent = config.plugins.MyMetrix.Color.Background.value.replace('#00', '#ff')
            colors = skinNode.getElementsByTagName('colors')[0]
            for color in colors.getElementsByTagName('color'):
                colorname = color.getAttributeNode('name').nodeValue
                self['output'].setText(_(str('Setting color: ' + colorname)))
                if colorname == 'metrixSelection':
                    color.setAttribute('value', _selection)
                elif colorname == 'metrixBackground':
                    color.setAttribute('value', _background)
                elif colorname == 'metrixBackground2':
                    color.setAttribute('value', _background2)
                elif colorname == 'metrixPreTrans':
                    color.setAttribute('value', _BackgroundText)
                elif colorname == 'metrixPreTrans2':
                    color.setAttribute('value', _BackgroundText)
                elif colorname == 'metrixForeground':
                    color.setAttribute('value', _Foreground)
                elif colorname == 'metrixAccent1':
                    color.setAttribute('value', _Accent1)
                elif colorname == 'metrixAccent2':
                    color.setAttribute('value', _Accent2)
                elif colorname == 'transparent':
                    color.setAttribute('value', _transparent)

        except:
            self['output'].setText(_(str('Error setting colors!')))
            print 'Error setting colors'
Ejemplo n.º 2
0
	def setColor(self,skinNode):
		###########READING DATA FILES
		try:
			if config.plugins.MyMetrix.Color.Selection.value == "CUSTOM":
				_selection = getHexColor(config.plugins.MyMetrix.Color.Selection_Custom.value,config.plugins.MyMetrix.Color.SelectionTransparency.value)
			else:
				_selection = config.plugins.MyMetrix.Color.Selection.value.replace("#00","#"+str(hex(int(config.plugins.MyMetrix.Color.SelectionTransparency.value))))
			
			if config.plugins.MyMetrix.Color.Background2.value == "CUSTOM":
				_background2 = getHexColor(config.plugins.MyMetrix.Color.Background2_Custom.value,config.plugins.MyMetrix.Color.BackgroundTransparency.value)
			else:
				_background2 = config.plugins.MyMetrix.Color.Background2.value.replace("#00","#"+getHex(config.plugins.MyMetrix.Color.BackgroundTransparency.value))
			
			if config.plugins.MyMetrix.Color.Background.value == "CUSTOM":
				_background = getHexColor(config.plugins.MyMetrix.Color.Background_Custom.value,config.plugins.MyMetrix.Color.BackgroundTransparency.value)
			else:
				_background = config.plugins.MyMetrix.Color.Background.value.replace("#00","#"+getHex(config.plugins.MyMetrix.Color.BackgroundTransparency.value))
			
			if config.plugins.MyMetrix.Color.BackgroundText.value == "CUSTOM":
				_BackgroundText = getHexColor(config.plugins.MyMetrix.Color.BackgroundText_Custom.value, config.plugins.MyMetrix.Color.BackgroundTextTransparency.value)
			else:
				_BackgroundText = config.plugins.MyMetrix.Color.BackgroundText.value.replace("#00","#"+getHex(config.plugins.MyMetrix.Color.BackgroundTextTransparency.value))
			
			if config.plugins.MyMetrix.Color.Foreground.value == "CUSTOM":
				_Foreground = getHexColor(config.plugins.MyMetrix.Color.Foreground_Custom.value)
			else:
				_Foreground = config.plugins.MyMetrix.Color.Foreground.value
				
			if config.plugins.MyMetrix.Color.Accent1.value == "CUSTOM":
				_Accent1 = getHexColor(config.plugins.MyMetrix.Color.Accent1_Custom.value)
			else:
				_Accent1 = config.plugins.MyMetrix.Color.Accent1.value
			
			if config.plugins.MyMetrix.Color.Accent2.value == "CUSTOM":
				_Accent2 = getHexColor(config.plugins.MyMetrix.Color.Accent2_Custom.value)
			else:
				_Accent2 = config.plugins.MyMetrix.Color.Accent2.value
			
			if config.plugins.MyMetrix.Color.Background.value == "CUSTOM":
				_transparent = getHexColor(config.plugins.MyMetrix.Color.Background_Custom.value,255)
			else:
				_transparent = config.plugins.MyMetrix.Color.Background.value.replace("#00","#ff")
			if config.plugins.MyMetrix.Color.BackgroundMode.value != "Dynamic":
				_transparent = config.plugins.MyMetrix.Color.BackgroundMode.value.replace("#00","#ff")
					
			colors = skinNode.getElementsByTagName('colors')[0]
			for color in colors.getElementsByTagName('color'):
				colorname = color.getAttributeNode('name').nodeValue
				metrixTools.callOnMainThread(self["output"].setText,_(str("Setting color: " + colorname)))
				if colorname == "metrixSelection":
					color.setAttribute('value',_selection)
				elif colorname == "metrixBackground":
					color.setAttribute('value',_background)
				elif colorname == "metrixBackground2":
					color.setAttribute('value',_background2)
				elif colorname == "metrixPreTrans":
					color.setAttribute('value',_BackgroundText)
				elif colorname == "metrixPreTrans2":
					color.setAttribute('value',_BackgroundText)
				elif colorname == "metrixForeground":
					color.setAttribute('value',_Foreground)
				elif colorname == "metrixAccent1":
					color.setAttribute('value',_Accent1)
				elif colorname == "metrixAccent2":
					color.setAttribute('value',_Accent2)
				elif colorname == "transparent":
					color.setAttribute('value',_transparent)
		except Exception, e:
			metrixTools.callOnMainThread(self["output"].setText,_(str("Error setting colors!")))
			metrixTools.log("Error setting colors",e)
Ejemplo n.º 3
0
 def layoutFinish(self):
     if config.plugins.MyMetrix.Color.Selection.value == 'CUSTOM':
         _selection = getHexColor(config.plugins.MyMetrix.Color.Selection_Custom.value, config.plugins.MyMetrix.Color.SelectionTransparency.value)
     else:
         _selection = config.plugins.MyMetrix.Color.Selection.value.replace('#00', '#' + str(hex(int(config.plugins.MyMetrix.Color.SelectionTransparency.value))))
     if config.plugins.MyMetrix.Color.Background2.value == 'CUSTOM':
         _background2 = getHexColor(config.plugins.MyMetrix.Color.Background2_Custom.value, config.plugins.MyMetrix.Color.BackgroundTransparency.value)
     else:
         _background2 = config.plugins.MyMetrix.Color.Background2.value.replace('#00', '#' + getHex(config.plugins.MyMetrix.Color.BackgroundTransparency.value))
     if config.plugins.MyMetrix.Color.Background.value == 'CUSTOM':
         _background = getHexColor(config.plugins.MyMetrix.Color.Background_Custom.value, config.plugins.MyMetrix.Color.BackgroundTransparency.value)
     else:
         _background = config.plugins.MyMetrix.Color.Background.value.replace('#00', '#' + getHex(config.plugins.MyMetrix.Color.BackgroundTransparency.value))
     if config.plugins.MyMetrix.Color.BackgroundText.value == 'CUSTOM':
         _BackgroundText = getHexColor(config.plugins.MyMetrix.Color.BackgroundText_Custom.value, config.plugins.MyMetrix.Color.BackgroundTextTransparency.value)
     else:
         _BackgroundText = config.plugins.MyMetrix.Color.BackgroundText.value.replace('#00', '#' + getHex(config.plugins.MyMetrix.Color.BackgroundTextTransparency.value))
     if config.plugins.MyMetrix.Color.Foreground.value == 'CUSTOM':
         _Foreground = getHexColor(config.plugins.MyMetrix.Color.Foreground_Custom.value)
     else:
         _Foreground = config.plugins.MyMetrix.Color.Foreground.value
     if config.plugins.MyMetrix.Color.Accent1.value == 'CUSTOM':
         _Accent1 = getHexColor(config.plugins.MyMetrix.Color.Accent1_Custom.value)
     else:
         _Accent1 = config.plugins.MyMetrix.Color.Accent1.value
     if config.plugins.MyMetrix.Color.Accent2.value == 'CUSTOM':
         _Accent2 = getHexColor(config.plugins.MyMetrix.Color.Accent2_Custom.value)
     else:
         _Accent2 = config.plugins.MyMetrix.Color.Accent2.value
     if config.plugins.MyMetrix.Color.Background.value == 'CUSTOM':
         _transparent = getHexColor(config.plugins.MyMetrix.Color.Background_Custom.value, '255')
     else:
         _transparent = config.plugins.MyMetrix.Color.Background.value.replace('#00', '#ff')
     self['InfoBar_BG'].instance.setBackgroundColor(parseColor(_background))
     self['WeatherWidget_BG'].instance.setBackgroundColor(parseColor(_background))
     self['WeatherWidget_BG2'].instance.setBackgroundColor(parseColor(_background2))
     self['EPGNow_BG'].instance.setBackgroundColor(parseColor(_background))
     self['EPGNext_BG'].instance.setBackgroundColor(parseColor(_background2))
     self['ClockWidget_BG'].instance.setBackgroundColor(parseColor(_background))
     self['Clock'].instance.setForegroundColor(parseColor(_Foreground))
     self['Clock'].instance.setBackgroundColor(parseColor(_background))
     self['Clock_Day'].instance.setForegroundColor(parseColor(_Accent1))
     self['Clock_Day'].instance.setBackgroundColor(parseColor(_background))
     self['Clock_Date'].instance.setForegroundColor(parseColor(_Accent1))
     self['Clock_Date'].instance.setBackgroundColor(parseColor(_background))
     self['Event_Now'].instance.setForegroundColor(parseColor(_Foreground))
     self['Event_Now'].instance.setBackgroundColor(parseColor(_background))
     self['Event_Next'].instance.setForegroundColor(parseColor(_Accent1))
     self['Event_Next'].instance.setBackgroundColor(parseColor(_background2))
     self['Now'].instance.setForegroundColor(parseColor(_Foreground))
     self['Now'].instance.setBackgroundColor(parseColor(_background))
     self['Next'].instance.setForegroundColor(parseColor(_Accent1))
     self['Next'].instance.setBackgroundColor(parseColor(_background))
     self['Event_No'].instance.setForegroundColor(parseColor(_Foreground))
     self['Event_No'].instance.setBackgroundColor(parseColor(_background))
     self['Event_Ne'].instance.setForegroundColor(parseColor(_Accent1))
     self['Event_Ne'].instance.setBackgroundColor(parseColor(_background2))
     self['Now_Time'].instance.setForegroundColor(parseColor(_Foreground))
     self['Now_Time'].instance.setBackgroundColor(parseColor(_background))
     self['Now_Timer'].instance.setForegroundColor(parseColor(_Foreground))
     self['Now_Timer'].instance.setBackgroundColor(parseColor(_background))
     self['Next_Timer'].instance.setForegroundColor(parseColor(_Accent1))
     self['Next_Timer'].instance.setBackgroundColor(parseColor(_background))
     self['Channelname'].instance.setForegroundColor(parseColor(_BackgroundText))
     self['ProgressBar'].instance.setBackgroundColor(parseColor(config.plugins.MyMetrix.Color.ProgressBar.value))
     self['ProgressBarBack'].instance.setBackgroundColor(parseColor(_Accent1))
     self['Temp'].instance.setForegroundColor(parseColor(_Foreground))
     self['Temp'].instance.setBackgroundColor(parseColor(_background))
     self['TempC'].instance.setForegroundColor(parseColor(_Foreground))
     self['TempC'].instance.setBackgroundColor(parseColor(_background))
     self['TempA'].instance.setForegroundColor(parseColor(_Accent1))
     self['TempA'].instance.setBackgroundColor(parseColor(_background))
     self['TempB'].instance.setForegroundColor(parseColor(_Accent2))
     self['TempB'].instance.setBackgroundColor(parseColor(_background))
     self['TempCode'].instance.setForegroundColor(parseColor(_Foreground))
     self['TempCode'].instance.setBackgroundColor(parseColor(_background))
     self['TempC2'].instance.setForegroundColor(parseColor(_Accent1))
     self['TempC2'].instance.setBackgroundColor(parseColor(_background2))
     self['TempD'].instance.setForegroundColor(parseColor(_Accent2))
     self['TempD'].instance.setBackgroundColor(parseColor(_background2))
     self['TempCode2'].instance.setForegroundColor(parseColor(_Accent1))
     self['TempCode2'].instance.setBackgroundColor(parseColor(_background2))
     self['Crypt'].instance.setBackgroundColor(parseColor(_selection))
     self['B'].instance.setForegroundColor(parseColor(_Foreground))
     self['B'].instance.setBackgroundColor(parseColor(_background))
     self['I'].instance.setForegroundColor(parseColor(_Accent1))
     self['I'].instance.setBackgroundColor(parseColor(_background))
     self['S'].instance.setForegroundColor(parseColor(_Accent1))
     self['S'].instance.setBackgroundColor(parseColor(_background))
     self['V'].instance.setForegroundColor(parseColor(_Accent1))
     self['V'].instance.setBackgroundColor(parseColor(_background))
     self['N'].instance.setForegroundColor(parseColor(_Foreground))
     self['N'].instance.setBackgroundColor(parseColor(_background))
     self['CW'].instance.setForegroundColor(parseColor(_Accent1))
     self['CW'].instance.setBackgroundColor(parseColor(_background))
     self['ND'].instance.setForegroundColor(parseColor(_Foreground))
     self['ND'].instance.setBackgroundColor(parseColor(_background))
     self['CO'].instance.setForegroundColor(parseColor(_Accent1))
     self['CO'].instance.setBackgroundColor(parseColor(_background))
     self.instance.setBackgroundColor(parseColor(_transparent))
Ejemplo n.º 4
0
 def layoutFinish(self):
     if config.plugins.MyMetrix.Color.Selection.value == 'CUSTOM':
         _selection = getHexColor(
             config.plugins.MyMetrix.Color.Selection_Custom.value,
             config.plugins.MyMetrix.Color.SelectionTransparency.value)
     else:
         _selection = config.plugins.MyMetrix.Color.Selection.value.replace(
             '#00', '#' + str(
                 hex(
                     int(config.plugins.MyMetrix.Color.
                         SelectionTransparency.value))))
     if config.plugins.MyMetrix.Color.Background2.value == 'CUSTOM':
         _background2 = getHexColor(
             config.plugins.MyMetrix.Color.Background2_Custom.value,
             config.plugins.MyMetrix.Color.BackgroundTransparency.value)
     else:
         _background2 = config.plugins.MyMetrix.Color.Background2.value.replace(
             '#00', '#' + getHex(config.plugins.MyMetrix.Color.
                                 BackgroundTransparency.value))
     if config.plugins.MyMetrix.Color.Background.value == 'CUSTOM':
         _background = getHexColor(
             config.plugins.MyMetrix.Color.Background_Custom.value,
             config.plugins.MyMetrix.Color.BackgroundTransparency.value)
     else:
         _background = config.plugins.MyMetrix.Color.Background.value.replace(
             '#00', '#' + getHex(config.plugins.MyMetrix.Color.
                                 BackgroundTransparency.value))
     if config.plugins.MyMetrix.Color.BackgroundText.value == 'CUSTOM':
         _BackgroundText = getHexColor(
             config.plugins.MyMetrix.Color.BackgroundText_Custom.value,
             config.plugins.MyMetrix.Color.BackgroundTextTransparency.value)
     else:
         _BackgroundText = config.plugins.MyMetrix.Color.BackgroundText.value.replace(
             '#00', '#' + getHex(config.plugins.MyMetrix.Color.
                                 BackgroundTextTransparency.value))
     if config.plugins.MyMetrix.Color.Foreground.value == 'CUSTOM':
         _Foreground = getHexColor(
             config.plugins.MyMetrix.Color.Foreground_Custom.value)
     else:
         _Foreground = config.plugins.MyMetrix.Color.Foreground.value
     if config.plugins.MyMetrix.Color.Accent1.value == 'CUSTOM':
         _Accent1 = getHexColor(
             config.plugins.MyMetrix.Color.Accent1_Custom.value)
     else:
         _Accent1 = config.plugins.MyMetrix.Color.Accent1.value
     if config.plugins.MyMetrix.Color.Accent2.value == 'CUSTOM':
         _Accent2 = getHexColor(
             config.plugins.MyMetrix.Color.Accent2_Custom.value)
     else:
         _Accent2 = config.plugins.MyMetrix.Color.Accent2.value
     if config.plugins.MyMetrix.Color.Background.value == 'CUSTOM':
         _transparent = getHexColor(
             config.plugins.MyMetrix.Color.Background_Custom.value, '255')
     else:
         _transparent = config.plugins.MyMetrix.Color.Background.value.replace(
             '#00', '#ff')
     self['InfoBar_BG'].instance.setBackgroundColor(parseColor(_background))
     self['WeatherWidget_BG'].instance.setBackgroundColor(
         parseColor(_background))
     self['WeatherWidget_BG2'].instance.setBackgroundColor(
         parseColor(_background2))
     self['EPGNow_BG'].instance.setBackgroundColor(parseColor(_background))
     self['EPGNext_BG'].instance.setBackgroundColor(
         parseColor(_background2))
     self['ClockWidget_BG'].instance.setBackgroundColor(
         parseColor(_background))
     self['Clock'].instance.setForegroundColor(parseColor(_Foreground))
     self['Clock'].instance.setBackgroundColor(parseColor(_background))
     self['Clock_Day'].instance.setForegroundColor(parseColor(_Accent1))
     self['Clock_Day'].instance.setBackgroundColor(parseColor(_background))
     self['Clock_Date'].instance.setForegroundColor(parseColor(_Accent1))
     self['Clock_Date'].instance.setBackgroundColor(parseColor(_background))
     self['Event_Now'].instance.setForegroundColor(parseColor(_Foreground))
     self['Event_Now'].instance.setBackgroundColor(parseColor(_background))
     self['Event_Next'].instance.setForegroundColor(parseColor(_Accent1))
     self['Event_Next'].instance.setBackgroundColor(
         parseColor(_background2))
     self['Now'].instance.setForegroundColor(parseColor(_Foreground))
     self['Now'].instance.setBackgroundColor(parseColor(_background))
     self['Next'].instance.setForegroundColor(parseColor(_Accent1))
     self['Next'].instance.setBackgroundColor(parseColor(_background))
     self['Event_No'].instance.setForegroundColor(parseColor(_Foreground))
     self['Event_No'].instance.setBackgroundColor(parseColor(_background))
     self['Event_Ne'].instance.setForegroundColor(parseColor(_Accent1))
     self['Event_Ne'].instance.setBackgroundColor(parseColor(_background2))
     self['Now_Time'].instance.setForegroundColor(parseColor(_Foreground))
     self['Now_Time'].instance.setBackgroundColor(parseColor(_background))
     self['Now_Timer'].instance.setForegroundColor(parseColor(_Foreground))
     self['Now_Timer'].instance.setBackgroundColor(parseColor(_background))
     self['Next_Timer'].instance.setForegroundColor(parseColor(_Accent1))
     self['Next_Timer'].instance.setBackgroundColor(parseColor(_background))
     self['Channelname'].instance.setForegroundColor(
         parseColor(_BackgroundText))
     self['ProgressBar'].instance.setBackgroundColor(
         parseColor(config.plugins.MyMetrix.Color.ProgressBar.value))
     self['ProgressBarBack'].instance.setBackgroundColor(
         parseColor(_Accent1))
     self['Temp'].instance.setForegroundColor(parseColor(_Foreground))
     self['Temp'].instance.setBackgroundColor(parseColor(_background))
     self['TempC'].instance.setForegroundColor(parseColor(_Foreground))
     self['TempC'].instance.setBackgroundColor(parseColor(_background))
     self['TempA'].instance.setForegroundColor(parseColor(_Accent1))
     self['TempA'].instance.setBackgroundColor(parseColor(_background))
     self['TempB'].instance.setForegroundColor(parseColor(_Accent2))
     self['TempB'].instance.setBackgroundColor(parseColor(_background))
     self['TempCode'].instance.setForegroundColor(parseColor(_Foreground))
     self['TempCode'].instance.setBackgroundColor(parseColor(_background))
     self['TempC2'].instance.setForegroundColor(parseColor(_Accent1))
     self['TempC2'].instance.setBackgroundColor(parseColor(_background2))
     self['TempD'].instance.setForegroundColor(parseColor(_Accent2))
     self['TempD'].instance.setBackgroundColor(parseColor(_background2))
     self['TempCode2'].instance.setForegroundColor(parseColor(_Accent1))
     self['TempCode2'].instance.setBackgroundColor(parseColor(_background2))
     self['Crypt'].instance.setBackgroundColor(parseColor(_selection))
     self['B'].instance.setForegroundColor(parseColor(_Foreground))
     self['B'].instance.setBackgroundColor(parseColor(_background))
     self['I'].instance.setForegroundColor(parseColor(_Accent1))
     self['I'].instance.setBackgroundColor(parseColor(_background))
     self['S'].instance.setForegroundColor(parseColor(_Accent1))
     self['S'].instance.setBackgroundColor(parseColor(_background))
     self['V'].instance.setForegroundColor(parseColor(_Accent1))
     self['V'].instance.setBackgroundColor(parseColor(_background))
     self['N'].instance.setForegroundColor(parseColor(_Foreground))
     self['N'].instance.setBackgroundColor(parseColor(_background))
     self['CW'].instance.setForegroundColor(parseColor(_Accent1))
     self['CW'].instance.setBackgroundColor(parseColor(_background))
     self['ND'].instance.setForegroundColor(parseColor(_Foreground))
     self['ND'].instance.setBackgroundColor(parseColor(_background))
     self['CO'].instance.setForegroundColor(parseColor(_Accent1))
     self['CO'].instance.setBackgroundColor(parseColor(_background))
     self.instance.setBackgroundColor(parseColor(_transparent))
Ejemplo n.º 5
0
	def layoutFinish(self):
		if config.plugins.MyMetrix.Color.Selection.value == "CUSTOM":
			_selection = getHexColor(config.plugins.MyMetrix.Color.Selection_Custom.value,config.plugins.MyMetrix.Color.SelectionTransparency.value)
		else:
			_selection = config.plugins.MyMetrix.Color.Selection.value.replace("#00","#"+str(hex(int(config.plugins.MyMetrix.Color.SelectionTransparency.value))))
		
		if config.plugins.MyMetrix.Color.Background2.value == "CUSTOM":
			_background2 = getHexColor(config.plugins.MyMetrix.Color.Background2_Custom.value,config.plugins.MyMetrix.Color.BackgroundTransparency.value)
		else:
			_background2 = config.plugins.MyMetrix.Color.Background2.value.replace("#00","#"+getHex(config.plugins.MyMetrix.Color.BackgroundTransparency.value))
		
		if config.plugins.MyMetrix.Color.Background.value == "CUSTOM":
			_background = getHexColor(config.plugins.MyMetrix.Color.Background_Custom.value,config.plugins.MyMetrix.Color.BackgroundTransparency.value)
		else:
			_background = config.plugins.MyMetrix.Color.Background.value.replace("#00","#"+getHex(config.plugins.MyMetrix.Color.BackgroundTransparency.value))
		
		if config.plugins.MyMetrix.Color.BackgroundText.value == "CUSTOM":
			_BackgroundText = getHexColor(config.plugins.MyMetrix.Color.BackgroundText_Custom.value, config.plugins.MyMetrix.Color.BackgroundTextTransparency.value)
		else:
			_BackgroundText = config.plugins.MyMetrix.Color.BackgroundText.value.replace("#00","#"+getHex(config.plugins.MyMetrix.Color.BackgroundTextTransparency.value))
		
		if config.plugins.MyMetrix.Color.Foreground.value == "CUSTOM":
			_Foreground = getHexColor(config.plugins.MyMetrix.Color.Foreground_Custom.value)
		else:
			_Foreground = config.plugins.MyMetrix.Color.Foreground.value
			
		if config.plugins.MyMetrix.Color.Accent1.value == "CUSTOM":
			_Accent1 = getHexColor(config.plugins.MyMetrix.Color.Accent1_Custom.value)
		else:
			_Accent1 = config.plugins.MyMetrix.Color.Accent1.value
		
		if config.plugins.MyMetrix.Color.Accent2.value == "CUSTOM":
			_Accent2 = getHexColor(config.plugins.MyMetrix.Color.Accent2_Custom.value)
		else:
			_Accent2 = config.plugins.MyMetrix.Color.Accent2.value
		
		if config.plugins.MyMetrix.Color.Background.value == "CUSTOM":
			_transparent = getHexColor(config.plugins.MyMetrix.Color.Background_Custom.value,"255")
		else:
			_transparent = config.plugins.MyMetrix.Color.Background.value.replace("#00","#ff")
			
			
		self["InfoBar_BG"].instance.setBackgroundColor(parseColor(_background))
		self["WeatherWidget_BG"].instance.setBackgroundColor(parseColor(_background))
		self["WeatherWidget_BG2"].instance.setBackgroundColor(parseColor(_background2))
		self["EPGNow_BG"].instance.setBackgroundColor(parseColor(_background))
		self["EPGNext_BG"].instance.setBackgroundColor(parseColor(_background2))
		self["ClockWidget_BG"].instance.setBackgroundColor(parseColor(_background))
		self["Clock"].instance.setForegroundColor(parseColor(_Foreground))
		self["Clock"].instance.setBackgroundColor(parseColor(_background))
		self["Clock_Day"].instance.setForegroundColor(parseColor(_Accent1))
		self["Clock_Day"].instance.setBackgroundColor(parseColor(_background))
		self["Clock_Date"].instance.setForegroundColor(parseColor(_Accent1))
		self["Clock_Date"].instance.setBackgroundColor(parseColor(_background))
		
		self["Event_Now"].instance.setForegroundColor(parseColor(_Foreground))
		self["Event_Now"].instance.setBackgroundColor(parseColor(_background))
		self["Event_Next"].instance.setForegroundColor(parseColor(_Accent1))
		self["Event_Next"].instance.setBackgroundColor(parseColor(_background2))
		
		self["Now"].instance.setForegroundColor(parseColor(_Foreground))
		self["Now"].instance.setBackgroundColor(parseColor(_background))
		self["Next"].instance.setForegroundColor(parseColor(_Accent1))
		self["Next"].instance.setBackgroundColor(parseColor(_background))
		
		self["Event_No"].instance.setForegroundColor(parseColor(_Foreground))
		self["Event_No"].instance.setBackgroundColor(parseColor(_background))
		self["Event_Ne"].instance.setForegroundColor(parseColor(_Accent1))
		self["Event_Ne"].instance.setBackgroundColor(parseColor(_background2))
		
		self["Now_Time"].instance.setForegroundColor(parseColor(_Foreground))
		self["Now_Time"].instance.setBackgroundColor(parseColor(_background))
		self["Now_Timer"].instance.setForegroundColor(parseColor(_Foreground))
		self["Now_Timer"].instance.setBackgroundColor(parseColor(_background))
		
		self["Next_Timer"].instance.setForegroundColor(parseColor(_Accent1))
		self["Next_Timer"].instance.setBackgroundColor(parseColor(_background))
		
		self["Channelname"].instance.setForegroundColor(parseColor(_BackgroundText))
		
		self["ProgressBar"].instance.setBackgroundColor(parseColor(config.plugins.MyMetrix.Color.ProgressBar.value))
		self["ProgressBarBack"].instance.setBackgroundColor(parseColor(_Accent1))
		
		self["Temp"].instance.setForegroundColor(parseColor(_Foreground))
		self["Temp"].instance.setBackgroundColor(parseColor(_background))
		self["TempC"].instance.setForegroundColor(parseColor(_Foreground))
		self["TempC"].instance.setBackgroundColor(parseColor(_background))
		self["TempA"].instance.setForegroundColor(parseColor(_Accent1))
		self["TempA"].instance.setBackgroundColor(parseColor(_background))
		self["TempB"].instance.setForegroundColor(parseColor(_Accent2))
		self["TempB"].instance.setBackgroundColor(parseColor(_background))
		self["TempCode"].instance.setForegroundColor(parseColor(_Foreground))
		self["TempCode"].instance.setBackgroundColor(parseColor(_background))
		
		self["TempC2"].instance.setForegroundColor(parseColor(_Accent1))
		self["TempC2"].instance.setBackgroundColor(parseColor(_background2))
		self["TempD"].instance.setForegroundColor(parseColor(_Accent2))
		self["TempD"].instance.setBackgroundColor(parseColor(_background2))
		self["TempCode2"].instance.setForegroundColor(parseColor(_Accent1))
		self["TempCode2"].instance.setBackgroundColor(parseColor(_background2))
		self["Crypt"].instance.setBackgroundColor(parseColor(_selection))
		
		self["B"].instance.setForegroundColor(parseColor(_Foreground))
		self["B"].instance.setBackgroundColor(parseColor(_background))
		
		self["I"].instance.setForegroundColor(parseColor(_Accent1))
		self["I"].instance.setBackgroundColor(parseColor(_background))
		
		self["S"].instance.setForegroundColor(parseColor(_Accent1))
		self["S"].instance.setBackgroundColor(parseColor(_background))
		
		self["V"].instance.setForegroundColor(parseColor(_Accent1))
		self["V"].instance.setBackgroundColor(parseColor(_background))
		
		self["N"].instance.setForegroundColor(parseColor(_Foreground))
		self["N"].instance.setBackgroundColor(parseColor(_background))
		
		self["CW"].instance.setForegroundColor(parseColor(_Accent1))
		self["CW"].instance.setBackgroundColor(parseColor(_background))
		
		self["ND"].instance.setForegroundColor(parseColor(_Foreground))
		self["ND"].instance.setBackgroundColor(parseColor(_background))
		
		self["CO"].instance.setForegroundColor(parseColor(_Accent1))
		self["CO"].instance.setBackgroundColor(parseColor(_background))
		
		
		
		
		
		
		
		self.instance.setBackgroundColor(parseColor(_transparent))
Ejemplo n.º 6
0
    def setColor(self, skinNode):
        try:
            if config.plugins.MyMetrix.Color.Selection.value == 'CUSTOM':
                _selection = getHexColor(
                    config.plugins.MyMetrix.Color.Selection_Custom.value,
                    config.plugins.MyMetrix.Color.SelectionTransparency.value)
            else:
                _selection = config.plugins.MyMetrix.Color.Selection.value.replace(
                    '#00', '#' + str(
                        hex(
                            int(config.plugins.MyMetrix.Color.
                                SelectionTransparency.value))))
            if config.plugins.MyMetrix.Color.Background2.value == 'CUSTOM':
                _background2 = getHexColor(
                    config.plugins.MyMetrix.Color.Background2_Custom.value,
                    config.plugins.MyMetrix.Color.BackgroundTransparency.value)
            else:
                _background2 = config.plugins.MyMetrix.Color.Background2.value.replace(
                    '#00', '#' + getHex(config.plugins.MyMetrix.Color.
                                        BackgroundTransparency.value))
            if config.plugins.MyMetrix.Color.Background.value == 'CUSTOM':
                _background = getHexColor(
                    config.plugins.MyMetrix.Color.Background_Custom.value,
                    config.plugins.MyMetrix.Color.BackgroundTransparency.value)
            else:
                _background = config.plugins.MyMetrix.Color.Background.value.replace(
                    '#00', '#' + getHex(config.plugins.MyMetrix.Color.
                                        BackgroundTransparency.value))
            if config.plugins.MyMetrix.Color.BackgroundText.value == 'CUSTOM':
                _BackgroundText = getHexColor(
                    config.plugins.MyMetrix.Color.BackgroundText_Custom.value,
                    config.plugins.MyMetrix.Color.BackgroundTextTransparency.
                    value)
            else:
                _BackgroundText = config.plugins.MyMetrix.Color.BackgroundText.value.replace(
                    '#00', '#' + getHex(config.plugins.MyMetrix.Color.
                                        BackgroundTextTransparency.value))
            if config.plugins.MyMetrix.Color.Foreground.value == 'CUSTOM':
                _Foreground = getHexColor(
                    config.plugins.MyMetrix.Color.Foreground_Custom.value)
            else:
                _Foreground = config.plugins.MyMetrix.Color.Foreground.value
            if config.plugins.MyMetrix.Color.Accent1.value == 'CUSTOM':
                _Accent1 = getHexColor(
                    config.plugins.MyMetrix.Color.Accent1_Custom.value)
            else:
                _Accent1 = config.plugins.MyMetrix.Color.Accent1.value
            if config.plugins.MyMetrix.Color.Accent2.value == 'CUSTOM':
                _Accent2 = getHexColor(
                    config.plugins.MyMetrix.Color.Accent2_Custom.value)
            else:
                _Accent2 = config.plugins.MyMetrix.Color.Accent2.value
            if config.plugins.MyMetrix.Color.Background.value == 'CUSTOM':
                _transparent = getHexColor(
                    config.plugins.MyMetrix.Color.Background_Custom.value, 255)
            else:
                _transparent = config.plugins.MyMetrix.Color.Background.value.replace(
                    '#00', '#ff')
            colors = skinNode.getElementsByTagName('colors')[0]
            for color in colors.getElementsByTagName('color'):
                colorname = color.getAttributeNode('name').nodeValue
                self['output'].setText(_(str('Setting color: ' + colorname)))
                if colorname == 'metrixSelection':
                    color.setAttribute('value', _selection)
                elif colorname == 'metrixBackground':
                    color.setAttribute('value', _background)
                elif colorname == 'metrixBackground2':
                    color.setAttribute('value', _background2)
                elif colorname == 'metrixPreTrans':
                    color.setAttribute('value', _BackgroundText)
                elif colorname == 'metrixPreTrans2':
                    color.setAttribute('value', _BackgroundText)
                elif colorname == 'metrixForeground':
                    color.setAttribute('value', _Foreground)
                elif colorname == 'metrixAccent1':
                    color.setAttribute('value', _Accent1)
                elif colorname == 'metrixAccent2':
                    color.setAttribute('value', _Accent2)
                elif colorname == 'transparent':
                    color.setAttribute('value', _transparent)

        except:
            self['output'].setText(_(str('Error setting colors!')))
            print 'Error setting colors'
Ejemplo n.º 7
0
	def layoutFinish(self):
		if config.plugins.MyMetrix.Color.Selection.value == "CUSTOM":
			_selection = getHexColor(config.plugins.MyMetrix.Color.Selection_Custom.value,config.plugins.MyMetrix.Color.SelectionTransparency.value)
		else:
			_selection = config.plugins.MyMetrix.Color.Selection.value.replace("#00","#"+str(hex(int(config.plugins.MyMetrix.Color.SelectionTransparency.value))))
		
		if config.plugins.MyMetrix.Color.Background2.value == "CUSTOM":
			_background2 = getHexColor(config.plugins.MyMetrix.Color.Background2_Custom.value,config.plugins.MyMetrix.Color.BackgroundTransparency.value)
		else:
			_background2 = config.plugins.MyMetrix.Color.Background2.value.replace("#00","#"+getHex(config.plugins.MyMetrix.Color.BackgroundTransparency.value))
		
		if config.plugins.MyMetrix.Color.Background.value == "CUSTOM":
			_background = getHexColor(config.plugins.MyMetrix.Color.Background_Custom.value,config.plugins.MyMetrix.Color.BackgroundTransparency.value)
		else:
			_background = config.plugins.MyMetrix.Color.Background.value.replace("#00","#"+getHex(config.plugins.MyMetrix.Color.BackgroundTransparency.value))
		
		if config.plugins.MyMetrix.Color.BackgroundText.value == "CUSTOM":
			_BackgroundText = getHexColor(config.plugins.MyMetrix.Color.BackgroundText_Custom.value, config.plugins.MyMetrix.Color.BackgroundTextTransparency.value)
		else:
			_BackgroundText = config.plugins.MyMetrix.Color.BackgroundText.value.replace("#00","#"+getHex(config.plugins.MyMetrix.Color.BackgroundTextTransparency.value))
		
		if config.plugins.MyMetrix.Color.Foreground.value == "CUSTOM":
			_Foreground = getHexColor(config.plugins.MyMetrix.Color.Foreground_Custom.value)
		else:
			_Foreground = config.plugins.MyMetrix.Color.Foreground.value
			
		if config.plugins.MyMetrix.Color.Accent1.value == "CUSTOM":
			_Accent1 = getHexColor(config.plugins.MyMetrix.Color.Accent1_Custom.value)
		else:
			_Accent1 = config.plugins.MyMetrix.Color.Accent1.value
		
		if config.plugins.MyMetrix.Color.Accent2.value == "CUSTOM":
			_Accent2 = getHexColor(config.plugins.MyMetrix.Color.Accent2_Custom.value)
		else:
			_Accent2 = config.plugins.MyMetrix.Color.Accent2.value
		
		if config.plugins.MyMetrix.Color.Background.value == "CUSTOM":
			_transparent = str(getHexColor(config.plugins.MyMetrix.Color.Background_Custom.value,"255")).replace("#00","#ff")
		else:
			_transparent = config.plugins.MyMetrix.Color.Background.value.replace("#00","#ff")
			
			
		self["InfoBar_BG"].instance.setBackgroundColor(parseColor(_background))
		self["WeatherWidget_BG"].instance.setBackgroundColor(parseColor(_background))
		self["WeatherWidget_BG2"].instance.setBackgroundColor(parseColor(_background2))
		self["EPGNow_BG"].instance.setBackgroundColor(parseColor(_background))
		self["EPGNext_BG"].instance.setBackgroundColor(parseColor(_background2))
		self["ClockWidget_BG"].instance.setBackgroundColor(parseColor(_background))
		self["Clock"].instance.setForegroundColor(parseColor(_Foreground))
		self["Clock"].instance.setBackgroundColor(parseColor(_background))
		self["Clock_Day"].instance.setForegroundColor(parseColor(_Accent1))
		self["Clock_Day"].instance.setBackgroundColor(parseColor(_background))
		self["Clock_Date"].instance.setForegroundColor(parseColor(_Accent1))
		self["Clock_Date"].instance.setBackgroundColor(parseColor(_background))
		
		self["Event_Now"].instance.setForegroundColor(parseColor(_Foreground))
		self["Event_Now"].instance.setBackgroundColor(parseColor(_background))
		self["Event_Next"].instance.setForegroundColor(parseColor(_Accent1))
		self["Event_Next"].instance.setBackgroundColor(parseColor(_background2))
		
		self["Now"].instance.setForegroundColor(parseColor(_Foreground))
		self["Now"].instance.setBackgroundColor(parseColor(_background))
		self["Next"].instance.setForegroundColor(parseColor(_Accent1))
		self["Next"].instance.setBackgroundColor(parseColor(_background))
		
		self["Event_No"].instance.setForegroundColor(parseColor(_Foreground))
		self["Event_No"].instance.setBackgroundColor(parseColor(_background))
		self["Event_Ne"].instance.setForegroundColor(parseColor(_Accent1))
		self["Event_Ne"].instance.setBackgroundColor(parseColor(_background2))
		
		self["Now_Time"].instance.setForegroundColor(parseColor(_Foreground))
		self["Now_Time"].instance.setBackgroundColor(parseColor(_background))
		self["Now_Timer"].instance.setForegroundColor(parseColor(_Foreground))
		self["Now_Timer"].instance.setBackgroundColor(parseColor(_background))
		
		self["Next_Timer"].instance.setForegroundColor(parseColor(_Accent1))
		self["Next_Timer"].instance.setBackgroundColor(parseColor(_background))
		
		self["ProgressBar"].instance.setBackgroundColor(parseColor(config.plugins.MyMetrix.Color.ProgressBar.value))
		self["ProgressBarBack"].instance.setBackgroundColor(parseColor(_Accent1))
		
		self["Temp"].instance.setForegroundColor(parseColor(_Foreground))
		self["Temp"].instance.setBackgroundColor(parseColor(_background))
		self["TempC"].instance.setForegroundColor(parseColor(_Foreground))
		self["TempC"].instance.setBackgroundColor(parseColor(_background))
		self["TempA"].instance.setForegroundColor(parseColor(_Accent1))
		self["TempA"].instance.setBackgroundColor(parseColor(_background))
		self["TempB"].instance.setForegroundColor(parseColor(_Accent2))
		self["TempB"].instance.setBackgroundColor(parseColor(_background))
		self["TempCode"].instance.setForegroundColor(parseColor(_Foreground))
		self["TempCode"].instance.setBackgroundColor(parseColor(_background))
		
		self["TempC2"].instance.setForegroundColor(parseColor(_Accent1))
		self["TempC2"].instance.setBackgroundColor(parseColor(_background2))
		self["TempD"].instance.setForegroundColor(parseColor(_Accent2))
		self["TempD"].instance.setBackgroundColor(parseColor(_background2))
		self["TempCode2"].instance.setForegroundColor(parseColor(_Accent1))
		self["TempCode2"].instance.setBackgroundColor(parseColor(_background2))
		self["Crypt"].instance.setBackgroundColor(parseColor(_selection))
		
		self["B"].instance.setForegroundColor(parseColor(_Foreground))
		self["B"].instance.setBackgroundColor(parseColor(_background))
		
		self["I"].instance.setForegroundColor(parseColor(_Accent1))
		self["I"].instance.setBackgroundColor(parseColor(_background))
		
		self["S"].instance.setForegroundColor(parseColor(_Accent1))
		self["S"].instance.setBackgroundColor(parseColor(_background))
		
		self["V"].instance.setForegroundColor(parseColor(_Accent1))
		self["V"].instance.setBackgroundColor(parseColor(_background))
		
		self["N"].instance.setForegroundColor(parseColor(_Foreground))
		self["N"].instance.setBackgroundColor(parseColor(_background))
		
		self["CW"].instance.setForegroundColor(parseColor(_Accent1))
		self["CW"].instance.setBackgroundColor(parseColor(_background))
		
		self["ND"].instance.setForegroundColor(parseColor(_Foreground))
		self["ND"].instance.setBackgroundColor(parseColor(_background))
		
		self["CO"].instance.setForegroundColor(parseColor(_Accent1))
		self["CO"].instance.setBackgroundColor(parseColor(_background))
		
		
		
		
		
		
		
		self.instance.setBackgroundColor(parseColor(_transparent))
Ejemplo n.º 8
0
    def setColor(self, skinNode):
        ###########READING DATA FILES
        try:
            if config.plugins.MyMetrix.Color.Selection.value == "CUSTOM":
                _selection = getHexColor(
                    config.plugins.MyMetrix.Color.Selection_Custom.value,
                    config.plugins.MyMetrix.Color.SelectionTransparency.value)
            else:
                _selection = config.plugins.MyMetrix.Color.Selection.value.replace(
                    "#00", "#" + str(
                        hex(
                            int(config.plugins.MyMetrix.Color.
                                SelectionTransparency.value))))

            if config.plugins.MyMetrix.Color.Background2.value == "CUSTOM":
                _background2 = getHexColor(
                    config.plugins.MyMetrix.Color.Background2_Custom.value,
                    config.plugins.MyMetrix.Color.BackgroundTransparency.value)
            else:
                _background2 = config.plugins.MyMetrix.Color.Background2.value.replace(
                    "#00", "#" + getHex(config.plugins.MyMetrix.Color.
                                        BackgroundTransparency.value))

            if config.plugins.MyMetrix.Color.Background.value == "CUSTOM":
                _background = getHexColor(
                    config.plugins.MyMetrix.Color.Background_Custom.value,
                    config.plugins.MyMetrix.Color.BackgroundTransparency.value)
            else:
                _background = config.plugins.MyMetrix.Color.Background.value.replace(
                    "#00", "#" + getHex(config.plugins.MyMetrix.Color.
                                        BackgroundTransparency.value))

            if config.plugins.MyMetrix.Color.BackgroundText.value == "CUSTOM":
                _BackgroundText = getHexColor(
                    config.plugins.MyMetrix.Color.BackgroundText_Custom.value,
                    config.plugins.MyMetrix.Color.BackgroundTextTransparency.
                    value)
            else:
                _BackgroundText = config.plugins.MyMetrix.Color.BackgroundText.value.replace(
                    "#00", "#" + getHex(config.plugins.MyMetrix.Color.
                                        BackgroundTextTransparency.value))

            if config.plugins.MyMetrix.Color.Foreground.value == "CUSTOM":
                _Foreground = getHexColor(
                    config.plugins.MyMetrix.Color.Foreground_Custom.value)
            else:
                _Foreground = config.plugins.MyMetrix.Color.Foreground.value

            if config.plugins.MyMetrix.Color.Accent1.value == "CUSTOM":
                _Accent1 = getHexColor(
                    config.plugins.MyMetrix.Color.Accent1_Custom.value)
            else:
                _Accent1 = config.plugins.MyMetrix.Color.Accent1.value

            if config.plugins.MyMetrix.Color.Accent2.value == "CUSTOM":
                _Accent2 = getHexColor(
                    config.plugins.MyMetrix.Color.Accent2_Custom.value)
            else:
                _Accent2 = config.plugins.MyMetrix.Color.Accent2.value

            if config.plugins.MyMetrix.Color.Background.value == "CUSTOM":
                _transparent = getHexColor(
                    config.plugins.MyMetrix.Color.Background_Custom.value, 255)
            else:
                _transparent = config.plugins.MyMetrix.Color.Background.value.replace(
                    "#00", "#ff")
            if config.plugins.MyMetrix.Color.BackgroundMode.value != "Dynamic":
                _transparent = config.plugins.MyMetrix.Color.BackgroundMode.value.replace(
                    "#00", "#ff")

            colors = skinNode.getElementsByTagName('colors')[0]
            for color in colors.getElementsByTagName('color'):
                colorname = color.getAttributeNode('name').nodeValue
                metrixTools.callOnMainThread(
                    self["output"].setText,
                    _(str("Setting color: " + colorname)))
                if colorname == "metrixSelection":
                    color.setAttribute('value', _selection)
                elif colorname == "metrixBackground":
                    color.setAttribute('value', _background)
                elif colorname == "metrixBackground2":
                    color.setAttribute('value', _background2)
                elif colorname == "metrixPreTrans":
                    color.setAttribute('value', _BackgroundText)
                elif colorname == "metrixPreTrans2":
                    color.setAttribute('value', _BackgroundText)
                elif colorname == "metrixForeground":
                    color.setAttribute('value', _Foreground)
                elif colorname == "metrixAccent1":
                    color.setAttribute('value', _Accent1)
                elif colorname == "metrixAccent2":
                    color.setAttribute('value', _Accent2)
                elif colorname == "transparent":
                    color.setAttribute('value', _transparent)
        except Exception, e:
            metrixTools.callOnMainThread(self["output"].setText,
                                         _(str("Error setting colors!")))
            metrixTools.log("Error setting colors", e)