docs: def get_rgb_from_xy_and_brightness(self, x, y, bri=1):
          """Inverse of `get_xy_point_from_rgb`. Returns (r, g, b) for given x, y values.
          Implementation of the instructions found on the Philips Hue iOS SDK docs: http://goo.gl/kWKXKl
          """
          # The xy to color conversion is almost the same, but in reverse order.
          # Check if the xy value is within the color gamut of the lamp.
          # If not continue with step 2, otherwise step 3.
          # We do this to calculate the most accurate color the given light can actually do.
          xy_point = XYPoint(x, y)
  
          if not self.check_point_in_lamps_reach(xy_point):
              # Calculate the closest point on the color gamut triangle
              # and use that as xy value See step 6 of color to xy.
              xy_point = self.get_closest_point_to_point(xy_point)
  
          # Calculate XYZ values Convert using the following formulas:
          Y = bri
          X = (Y / xy_point.y) * xy_point.x
          Z = (Y / xy_point.y) * (1 - xy_point.x - xy_point.y)
  
          # Convert to RGB using Wide RGB D65 conversion
          r = X * 1.656492 - Y * 0.354851 - Z * 0.255038
          g = -X * 0.707196 + Y * 1.655397 + Z * 0.036152
          b = X * 0.051713 - Y * 0.121364 + Z * 1.011530
  
          # Apply reverse gamma correction
          r, g, b = map(
              lambda x: (12.92 * x) if (x <= 0.0031308) else ((1.0 + 0.055) * pow(x, (1.0 / 2.4)) - 0.055),
              [r, g, b]
          )
  
          # Bring all negative components to zero
          r, g, b = map(lambda x: max(0, x), [r, g, b])
  
          # If one component is greater than 1, weight components by that value.
          max_component = max(r, g, b)
          if max_component > 1:
              r, g, b = map(lambda x: x / max_component, [r, g, b])
  
          r, g, b = map(lambda x: int(x * 255), [r, g, b])
  
          # Convert the RGB values to your color object The rgb values from the above formulas are between 0.0 and 1.0.
          return (r, g, b)