Пример #1
0
 def fill(self, r, g, b):
     fill = Color()
     fill.setRed(r)
     fill.setGreen(g)
     fill.setBlue(b)
     return "rgb({},{},{})".format(fill.getRed(), fill.getGreen(),
                                   fill.getBlue())
Пример #2
0
 def get_at(self, pos):
     """
     Return color of a surface pixel.
     The pos argument represents x,y position of pixel.
     """
     x,y = pos       #*tuple unpack error in jython applet
     try:
         color = Color(self.getRGB(x,y))
     except:     #ArrayOutOfBoundsException
         raise IndexError
     return color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()  #0.23
Пример #3
0
 def get_at(self, pos):
     """
     Return color of a surface pixel.
     The pos argument represents x,y position of pixel.
     """
     x, y = pos  #*tuple unpack error in jython applet
     try:
         color = Color(self.getRGB(x, y))
     except:  #ArrayOutOfBoundsException
         raise IndexError
     return color.getRed(), color.getGreen(), color.getBlue(
     ), color.getAlpha()  #0.23