title: Is there a way to get pygame to detect what color my cursor is on
body: <p>I'm trying to make a game where it spawns another circle every time you click on a circle. And the error i'm getting is &quot;TypeError: 'bool' object is not callable&quot;. I'm looking for a solution that doesn't completly change the code since i'm new and want to understand the code myself. But at this point i'll take any help.</p>
  <pre><code>import pygame
  import random
  import time
  from pygame.math import Vector2
  
  # Define some colors
  BLACK = (0, 0, 0)
  WHITE = (247, 247, 247)
  GREEN = (0, 255, 0)
  RED = (255, 0, 0)
  YELLOW = (225,225,0)
  tuple1 = (247, 247, 247, 255)
  # Setup
  pygame.init()
  # Set the width and height of the screen [width,height]
  surface = pygame.display.set_mode( (2560, 1440) ) 
  pygame.display.set_caption(&quot;My Game&quot;) 
  # Loop until the user clicks the close button.
  done = False 
  # Used to manage how fast the screen updates
  clock = pygame.time.Clock() 
  # Hide the mouse cursor
  pygame.mouse.set_visible(0) 
  # Speed in pixels per frame
  x_speed = 0
  y_speed = 0 
  # Current position
  cursor = pygame.image.load('cursor.png').convert_alpha()
  pygame.image.load(&quot;pattern.jpg&quot;)
  background_image = pygame.image.load(&quot;pattern.jpg&quot;).convert()
  circposy = 770
  circposx = 1280
  # -------- Main Program Loop -----------
  while done ==False:
      # --- Event Processing
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              done = True
          if event.type == pygame.MOUSEBUTTONDOWN:           
              done = True
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              done = True
      # --- Drawing Code
      surface.fill(WHITE)
      # First, clear the screen to WHITE. Don't put other drawing commands
      # above this, or they will be erased with this command.\
      player_position = pygame.mouse.get_pos()
      a = 0
      b = 1
      p=player_position[a]
      o=player_position[b]
      player_position = (p,o)
      pygame.draw.circle(surface,RED,[circposx,circposy], 40)
      tuple2 = surface.get_at(pygame.mouse.get_pos())
      print (tuple2)
      q = p - 2545
      w = o - 2545
      surface.blit( cursor, (q, w) )
      a=0
      result = tuple(map(int, tuple2)) &gt; tuple1
      print (result)
      while event.type == pygame.MOUSEBUTTONDOWN:
          done = True
          if result == True():
              a+1
              surface.fill(WHITE)
              pygame.draw.circle(surface,RED,[circposx + randint, circposy+randint],40)
      print (a)
      # Go ahead and update the screen with what we've drawn.
      pygame.display.flip()
      # Limit frames per second
      clock.tick(144) 
  # Close the window and quit.
  pygame.quit()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/yHlgS.png" rel="nofollow noreferrer">cursor.png</a></p>