示例#1
0
 def getAtomColor(self, i,N):
   
   h = i/float(N)
   s = 1
   v = 0.8
   [r,g,b] = hsbToRgb(h,s,v)
  
   return hexRepr(r,g,b)
示例#2
0
    def refreshColorBox(self, H):

        np = self.numPixels
        H = int(H) / 100.
        for x in range(np):
            for y in range(np):
                rgb = hsbToRgb(H, 1 - x / float(np), 1 - y / float(np))
                c = '#%02x%02x%02x' % (rgb[0] * 255, rgb[1] * 255,
                                       rgb[2] * 255)
                self.colorBox.itemconfigure(self.pixel[x][y],
                                            outline=c,
                                            fill=c)
                self.colors[x][y] = rgb
示例#3
0
    def setupColorBox(self):

        pw = self.pixelWidth
        np = self.numPixels
        for x in range(np):
            self.pixel.append([])
            self.colors.append([])
            for y in range(np):
                rgb = hsbToRgb(0, 1 - x / float(np), 1 - y / float(np))
                c = '#%02x%02x%02x' % (rgb[0] * 255, rgb[1] * 255,
                                       rgb[2] * 255)
                p = self.colorBox.create_rectangle(2 + pw * x,
                                                   2 + pw * y,
                                                   2 + (pw * x) + pw,
                                                   (2 + pw * y) + pw,
                                                   outline=c,
                                                   fill=c)
                self.pixel[x].append(p)
                self.colors[x].append(rgb)