code: def displayMousePosition(xOffset=0, yOffset=0):
      
      print('Press Ctrl-C to quit.')
      if xOffset != 0 or yOffset != 0:
          print('xOffset: %s yOffset: %s' % (xOffset, yOffset))
      resolution = size()
      try:
          while True:
              # Get and print the mouse coordinates.
              x, y = position()
              positionStr = 'X: ' + str(x - xOffset).rjust(4) + ' Y: ' + str(y - yOffset).rjust(4)
              if (x - xOffset) < 0 or (y - yOffset) < 0 or (x - xOffset) >= resolution[0] or (y - yOffset) >= resolution[1]:
                  pixelColor = ('NaN', 'NaN', 'NaN')
              else:
                  pixelColor = pyscreeze.screenshot().getpixel((x, y))
              positionStr += ' RGB: (' + str(pixelColor[0]).rjust(3)
              positionStr += ', ' + str(pixelColor[1]).rjust(3)
              positionStr += ', ' + str(pixelColor[2]).rjust(3) + ')'
              sys.stdout.write(positionStr)
              sys.stdout.write('\b' * len(positionStr))
              sys.stdout.flush()
      except KeyboardInterrupt:
          sys.stdout.write('\n')
          sys.stdout.flush()
docs: This function is meant to be run from the command line. It will
      automatically display the location and RGB of the mouse cursor.