code: def create_settings(self):
      self.scheme_choice = Choice(
          "Select a color scheme",
          [SCHEME_RGB, SCHEME_CMYK, SCHEME_STACK, SCHEME_COMPOSITE],
          doc="""\
  This module can use one of two color schemes to combine images:
  
  -  *%(SCHEME_RGB)s*: Each input image determines the intensity of one
     of the color channels: red, green, and blue.
  -  *%(SCHEME_CMYK)s*: Three of the input images are combined to
     determine the colors (cyan, magenta, and yellow) and a fourth is used
     only for brightness. The cyan image adds equally to the green and
     blue intensities. The magenta image adds equally to the red and blue
     intensities. The yellow image adds equally to the red and green
     intensities.
  -  *%(SCHEME_STACK)s*: The channels are stacked in the order listed,
     from top to bottom. An arbitrary number of channels is allowed.
  
     For example, you could create a 5-channel image by providing
     5 grayscale images. The first grayscale image you provide will fill
     the first channel, the second grayscale image you provide will fill
     the second channel, and so on.
  -  *%(SCHEME_COMPOSITE)s*: A color is assigned to each grayscale image.
     Each grayscale image is converted to color by multiplying the
     intensity by the color and the resulting color images are added
     together. An arbitrary number of channels can be composited into a
     single color image.
  """
          % globals(),
      )
  
      self.wants_rescale = Binary(
          "Rescale intensity",
          True,
          doc="""\
  Choose whether to rescale each channel individually to 
  the range of 0-1. This prevents clipping of channels with intensity 
  above 1 and can help to balance the brightness of the different channels. 
  This option also ensures that channels occupy the full intensity range 
  available, which is useful for displaying images in other software.
  
  This rescaling is applied before any multiplication factors set in this 
  module's options. Using a multiplication factor >1 would therefore result 
  in clipping.""",
      )
  
      # # # # # # # # # # # # # # # #
      #
      # RGB settings
      #
      # # # # # # # # # # # # # # # #
      self.red_image_name = ImageSubscriber(
          "Select the image to be colored red",
          can_be_blank=True,
          blank_text=LEAVE_THIS_BLACK,
          doc="""\
  *(Used only if "%(SCHEME_RGB)s" is selected as the color scheme)*
  
  Select the input image to be displayed in red.
  """
          % globals(),
      )
  
      self.green_image_name = ImageSubscriber(
          "Select the image to be colored green",
          can_be_blank=True,
          blank_text=LEAVE_THIS_BLACK,
          doc="""\
  *(Used only if "%(SCHEME_RGB)s" is selected as the color scheme)*
  
  Select the input image to be displayed in green.
  """
          % globals(),
      )
  
      self.blue_image_name = ImageSubscriber(
          "Select the image to be colored blue",
          can_be_blank=True,
          blank_text=LEAVE_THIS_BLACK,
          doc="""\
  *(Used only if "%(SCHEME_RGB)s" is selected as the color scheme)*
  
  Select the input image to be displayed in blue.
  """
          % globals(),
      )
  
      self.rgb_image_name = ImageName(
          "Name the output image",
          "ColorImage",
          doc="""Enter a name for the resulting image.""",
      )
  
      self.red_adjustment_factor = Float(
          "Relative weight for the red image",
          value=1,
          minval=0,
          doc="""\
  *(Used only if "%(SCHEME_RGB)s" is selected as the color scheme)*
  
  Enter the relative weight for the red image. If all relative weights are
  equal, all three colors contribute equally in the final image. To weight
  colors relative to each other, increase or decrease the relative
  weights.
  """
          % globals(),
      )
  
      self.green_adjustment_factor = Float(
          "Relative weight for the green image",
          value=1,
          minval=0,
          doc="""\
  *(Used only if "%(SCHEME_RGB)s" is selected as the color scheme)*
  
  Enter the relative weight for the green image. If all relative weights
  are equal, all three colors contribute equally in the final image. To
  weight colors relative to each other, increase or decrease the relative
  weights.
  """
          % globals(),
      )
  
      self.blue_adjustment_factor = Float(
          "Relative weight for the blue image",
          value=1,
          minval=0,
          doc="""\
  *(Used only if "%(SCHEME_RGB)s" is selected as the color scheme)*
  
  Enter the relative weight for the blue image. If all relative weights
  are equal, all three colors contribute equally in the final image. To
  weight colors relative to each other, increase or decrease the relative
  weights.
  """
          % globals(),
      )
      # # # # # # # # # # # # # #
      #
      # CYMK settings
      #
      # # # # # # # # # # # # # #
      self.cyan_image_name = ImageSubscriber(
          "Select the image to be colored cyan",
          can_be_blank=True,
          blank_text=LEAVE_THIS_BLACK,
          doc="""\
  *(Used only if "%(SCHEME_CMYK)s" is selected as the color scheme)*
  
  Select the input image to be displayed in cyan.
  """
          % globals(),
      )
  
      self.magenta_image_name = ImageSubscriber(
          "Select the image to be colored magenta",
          can_be_blank=True,
          blank_text=LEAVE_THIS_BLACK,
          doc="""\
  *(Used only if "%(SCHEME_CMYK)s" is selected as the color scheme)*
  
  Select the input image to be displayed in magenta.
  """
          % globals(),
      )
  
      self.yellow_image_name = ImageSubscriber(
          "Select the image to be colored yellow",
          can_be_blank=True,
          blank_text=LEAVE_THIS_BLACK,
          doc="""\
  *(Used only if "%(SCHEME_CMYK)s" is selected as the color scheme)*
  
  Select the input image to be displayed in yellow.
  """
          % globals(),
      )
  
      self.gray_image_name = ImageSubscriber(
          "Select the image that determines brightness",
          can_be_blank=True,
          blank_text=LEAVE_THIS_BLACK,
          doc="""\
  *(Used only if "%(SCHEME_CMYK)s" is selected as the color scheme)*
  
  Select the input image that will determine each pixel's brightness.
  """
          % globals(),
      )
  
      self.cyan_adjustment_factor = Float(
          "Relative weight for the cyan image",
          value=1,
          minval=0,
          doc="""\
  *(Used only if "%(SCHEME_CMYK)s" is selected as the color scheme)*
  
  Enter the relative weight for the cyan image. If all relative weights
  are equal, all colors contribute equally in the final image. To weight
  colors relative to each other, increase or decrease the relative
  weights.
  """
          % globals(),
      )
  
      self.magenta_adjustment_factor = Float(
          "Relative weight for the magenta image",
          value=1,
          minval=0,
          doc="""\
  *(Used only if "%(SCHEME_CMYK)s" is selected as the color scheme)*
  
  Enter the relative weight for the magenta image. If all relative weights
  are equal, all colors contribute equally in the final image. To weight
  colors relative to each other, increase or decrease the relative
  weights.
  """
          % globals(),
      )
  
      self.yellow_adjustment_factor = Float(
          "Relative weight for the yellow image",
          value=1,
          minval=0,
          doc="""\
  *(Used only if "%(SCHEME_CMYK)s" is selected as the color scheme)*
  
  Enter the relative weight for the yellow image. If all relative weights
  are equal, all colors contribute equally in the final image. To weight
  colors relative to each other, increase or decrease the relative
  weights.
  """
          % globals(),
      )
  
      self.gray_adjustment_factor = Float(
          "Relative weight for the brightness image",
          value=1,
          minval=0,
          doc="""\
  *(Used only if "%(SCHEME_CMYK)s" is selected as the color scheme)*
  
  Enter the relative weight for the brightness image. If all relative
  weights are equal, all colors contribute equally in the final image. To
  weight colors relative to each other, increase or decrease the relative
  weights.
  """
          % globals(),
      )
  
      # # # # # # # # # # # # # #
      #
      # Stack settings
      #
      # # # # # # # # # # # # # #
  
      self.stack_channels = []
      self.stack_channel_count = HiddenCount(self.stack_channels)
      self.add_stack_channel_cb(can_remove=False)
      self.add_stack_channel = DoSomething(
          "Add another channel",
          "Add another channel",
          self.add_stack_channel_cb,
          doc="""\
      Press this button to add another image to the stack.
      """,
      )
  
imports: import numpy
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Color, 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, RemoveSettingButton
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.text import ImageName, Float
label_desc: Use image node_id 1 for calling the GrayToColor obj's underlying member method code with example usage: obj.create_settings() without return types