def read_single_pixel(self, x: int, y: int, debug: bool = False) -> int:
        """
        Read the color of a single pixel from layer 0 of the display at x,y coordinates.

        :param int x: X coordinate of the pixel.
        :param int y: Y coordinate of the pixel.
        :param bool debug: Flag to enable debug printing.
        :return: Color of the pixel in RGB format (24-bit).
        :rtype: int
        """
        # Ensure x and y are within display bounds
        if not (0 <= x < self.width and 0 <= y < self.height):
            raise ValueError(f"Coordinates ({x}, {y}) out of bounds for display size {self.width}x{self.height}")
        if debug:
            print(f"Reading pixel at ({x}, {y})")

        # Set graphics mode
        self._gfx_mode()
        # Set read cursor position for layer0 (800x480 8-bit bus mode 16-bit color mode)
        self._write_reg16(reg.RCURH0, x, debug=False)
        self._write_reg16(reg.RCURV0, y + self.vert_offset, debug=False)
        # Set Memory Read/Write Control 
        self._read_reg(reg.MRWC)
        # Read the color data
        dummy = self._read_data16(debug=False)  # Dummy read
        msb = self._read_data16(debug=False)    # MSB read

        # Extract color components from MSB
        green = (msb >> 8) & 0xFF   # Extracting 8 bits of green component
        blue = (msb >> 3) & 0xFF   # Extracting 8 bits of blue component
        red = (msb << 3) & 0xFF  # Extracting 8 bits of red component
        if debug: 
            print(f"Dummy: {dummy} MSB: {msb}")
            print(f"Extracted Colors: {red}, {green}, {blue}")
            print(f"Binary values: Red: {red:08b}, Green: {green:08b}, Blue: {blue:08b}")
        
        return red, green, blue