colors property

  1. @memoized
HueColor? colors

get the current color of the light in all possible means by the bridge

Implementation

@memoized
HueColor? get colors {
  final colorHelper = ColorHelper();
  if (state!.colorMode == 'ct') {
    return colorHelper.ctToRGB(state!.ct!);
  } else if (state!.colorMode == 'hs') {
    return colorHelper.hueSaturationBrightnessToRGB(
        state!.hue!, state!.saturation!, state!.brightness!);
  } else if (state!.colorMode == 'xy') {
    return colorHelper.xyToRGB(
        state!.xy![0], state!.xy![1], state!.brightness);
  }
  return null;
}