Set backlight color to provided red, green, and blue values.  If PWM
        is enabled then color components can be values from 0.0 to 1.0, otherwise
        components should be zero for off and non-zero for on.

def set_color(self, red, green, blue):
        """Set backlight color to provided red, green, and blue values.  If PWM
        is enabled then color components can be values from 0.0 to 1.0, otherwise
        components should be zero for off and non-zero for on.
        """
        if self._pwm_enabled:
            # Set duty cycle of PWM pins.
            rdc, gdc, bdc = self._rgb_to_duty_cycle((red, green, blue))
            self._red.pwm_start(rdc)
            self._green.pwm.start(gdc)
            self._blue.pwm.start(bdc)
        else:
            # Set appropriate backlight pins based on polarity and enabled colors.
            self._red.set(self._blpol if red else not self._blpol)
            self._green.set(self._blpol if green else not self._blpol)
            self._blue.set(self._blpol if blue else not self._blpol)