Ejemplo n.º 1
0
    def setRGB(self, r, g, b):
        # To prevent value oscillation               
        if (round(r), round(g), round(b)) == (round(self.__rCache), round(self.__gCache), round(self.__bCache)):
            return
              
        self.__r = r
        self.__g = g
        self.__b = b

        (self.__h, self.__s, self.__v) = ColorUtil.rgb2hsv(self.__r, self.__g, self.__b)
        (self.__hCache, self.__sCache, self.__vCache) = (self.__h, self.__s, self.__v)
        
        self.notifyObservers()