def __paintRamp( self, painter ) :

		if self.__gradientToDraw is None :
			self.__gradientToDraw = QtGui.QLinearGradient( 0, 0, 1, 0 )
			self.__gradientToDraw.setCoordinateMode( self.__gradientToDraw.ObjectBoundingMode )

			displayTransform = GafferUI.DisplayTransform.get()

			numStops = 500
			for i in range( 0, numStops ) :
				t = float( i ) / ( numStops - 1 )
				c = self.__spline( t )
				if isinstance( c, float ) :
					c = IECore.Color3f( c, c, c )
				else :
					c = IECore.Color3f( c[0], c[1], c[2] )

				c = displayTransform( c )
				self.__gradientToDraw.setColorAt( t, self._qtColor( c ) )

		brush = QtGui.QBrush( self.__gradientToDraw )
		rect = self._qtWidget().contentsRect()
		painter.fillRect( rect, brush )
dataset/ETHPy150Open ImageEngine/gaffer/python/GafferUI/SplineWidget.py/SplineWidget.__paintRamp/original