Esempio n. 1
0
	def setColoredLineColor( self, coloredLine, colorTuple ):
		'Set the color and stipple of the colored line.'
		layerZoneIndex = self.getLayerZoneIndex( coloredLine.z )
		multiplier = self.repository.bottomLayerBrightness.value
		if len( self.layerTops ) > 1:
			multiplier += self.oneMinusBrightnessOverTopLayerIndex * float( layerZoneIndex )
		bandIndex = layerZoneIndex / self.repository.bandHeight.value
		if self.repository.fromTheTop.value:
			brightZoneIndex = len( self.layerTops ) - 1 - layerZoneIndex
			bandIndex = brightZoneIndex / self.repository.bandHeight.value + 1
		if bandIndex % 2 == 0:
			multiplier *= self.repository.bottomBandBrightness.value
		red = settings.getWidthHex( int( colorTuple[ 0 ] * multiplier ), 2 )
		green = settings.getWidthHex( int( colorTuple[ 1 ] * multiplier ), 2 )
		blue = settings.getWidthHex( int( colorTuple[ 2 ] * multiplier ), 2 )
		coloredLine.colorName = '#%s%s%s' % ( red, green, blue )
Esempio n. 2
0
 def setColoredLineColor(self, coloredLine, colorTuple):
     'Set the color and stipple of the colored line.'
     layerZoneIndex = self.getLayerZoneIndex(coloredLine.z)
     multiplier = self.repository.bottomLayerBrightness.value
     if len(self.layerTops) > 1:
         multiplier += self.oneMinusBrightnessOverTopLayerIndex * float(
             layerZoneIndex)
     bandIndex = layerZoneIndex / self.repository.bandHeight.value
     if self.repository.fromTheTop.value:
         brightZoneIndex = len(self.layerTops) - 1 - layerZoneIndex
         bandIndex = brightZoneIndex / self.repository.bandHeight.value + 1
     if bandIndex % 2 == 0:
         multiplier *= self.repository.bottomBandBrightness.value
     red = settings.getWidthHex(int(colorTuple[0] * multiplier), 2)
     green = settings.getWidthHex(int(colorTuple[1] * multiplier), 2)
     blue = settings.getWidthHex(int(colorTuple[2] * multiplier), 2)
     coloredLine.colorName = '#%s%s%s' % (red, green, blue)
Esempio n. 3
0
 def printHexadecimalColorName(self, name):
     "Print the color name in hexadecimal."
     colorTuple = self.canvas.winfo_rgb(name)
     print('#%s%s%s' % (settings.getWidthHex(
         colorTuple[0], 2), settings.getWidthHex(
             colorTuple[1], 2), settings.getWidthHex(colorTuple[2], 2)))
Esempio n. 4
0
	def printHexadecimalColorName( self, name ):
		"Print the color name in hexadecimal."
		colorTuple = self.canvas.winfo_rgb( name )
		print( '#%s%s%s' % ( settings.getWidthHex( colorTuple[ 0 ], 2 ), settings.getWidthHex( colorTuple[ 1 ], 2 ), settings.getWidthHex( colorTuple[ 2 ], 2 ) ) )