docstr: Return tuples of channel indexes and their relative contributions
  
  Used when combining channels to find the channels to combine
docstr_tok: ["Return","tuples","of","channel","indexes","and","their","relative","contributions","Used","when","combining","channels","to","find","the","channels","to","combine"]
code: def channels_and_contributions(self):
      """Return tuples of channel indexes and their relative contributions
  
      Used when combining channels to find the channels to combine
      """
      if self.rgb_or_channels in (CH_RGB, CH_HSV):
          return [
              (i, contribution.value)
              for i, contribution in enumerate(
                  (
                      self.red_contribution,
                      self.green_contribution,
                      self.blue_contribution,
                  )
              )
          ]
  
      return [
          (
              self.get_channel_idx_from_choice(
                  channel.channel_choice.value
              ),
              channel.contribution.value,
          )
          for channel in self.channels
      ]
  
imports: import re
  import matplotlib.colors
  import numpy
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import HiddenCount
  from cellprofiler_core.setting import SettingsGroup
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.do_something import DoSomething
  from cellprofiler_core.setting.do_something import RemoveSettingButton
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.text import Float
  from cellprofiler_core.setting.text import ImageName
  from cellprofiler_core.setting.text import Integer
label_desc: Use image node_id 8 for calling the ColorToGray obj's underlying member method code with example usage: obj.channels_and_contributions() and returns: unknown, unknown