def create_colorbutton_subform(self):
        """Create form for color button arguments."""
        ### define an starting offset
        offset = 5, 30

        ### create list to hold widget
        colorbutton_subform = List2D()

        ### instantiate value argument widgets

        ## define argument name
        arg_name = "value"

        ## instantiate and store text object

        text_obj = get_text_obj(reference_rect=self.rect, offset=offset, text=arg_name)

        colorbutton_subform.append(text_obj)

        ## define needed arguments, instantiate and store
        ## widget for the color button value

        # define widget name
        widget_name = arg_name

        # define position data

        offset = 55, offset[1] + 5
        coordinates_name = "topleft"
        coordinates_value = self.rect.move(offset).topleft

        # instantiate and store

        value_colorbutton = ColorButton(
            name=widget_name,
            coordinates_name=coordinates_name,
            coordinates_value=coordinates_value,
        )

        colorbutton_subform.append(value_colorbutton)

        ### instantiate color format argument widgets

        ## define argument name
        arg_name = "color_format"

        ## update offset
        offset = 5, offset[1] + 25

        ## instantiate and store text object

        text_obj = get_text_obj(reference_rect=self.rect, offset=offset, text=arg_name)

        colorbutton_subform.append(text_obj)

        ## define needed arguments, instantiate and store
        ## widget for the color button unit class name

        # define widget name
        widget_name = arg_name

        # define position data

        offset = 160, offset[1] + 5
        coordinates_name = "topleft"
        coordinates_value = self.rect.move(offset).topleft

        # define options
        options = ["rgb_ints", "hex_string"]

        # instantiate and store
        color_format_option_menu = OptionMenu(
            name=widget_name,
            loop_holder=self,
            value=options[0],
            options=options,
            draw_on_window_resize=self.draw,
            coordinates_name=coordinates_name,
            coordinates_value=coordinates_value,
        )

        colorbutton_subform.append(color_format_option_menu)

        ### instantiate single value format argument widgets

        ## define argument name
        arg_name = "alone_when_single"

        ## update offset
        offset = 5, offset[1] + 25

        ## instantiate and store text object

        text_obj = get_text_obj(reference_rect=self.rect, offset=offset, text=arg_name)

        colorbutton_subform.append(text_obj)

        ## define needed arguments, instantiate and store
        ## widget for the color button single value format

        # define widget name
        widget_name = arg_name

        # define position data

        offset = 160, offset[1] + 5
        coordinates_name = "topleft"
        coordinates_value = self.rect.move(offset).topleft

        # instantiate and store

        alone_when_single_checkbutton = CheckButton(
            value=True,
            name=widget_name,
            coordinates_name=coordinates_name,
            coordinates_value=coordinates_value,
        )

        colorbutton_subform.append(alone_when_single_checkbutton)

        ### create command for both option menus to
        ### update format of color button's value
        ### and assign such command to the option menus

        def update_format():
            """Update format of color button value."""
            color_format = color_format_option_menu.get()

            alone_when_single = alone_when_single_checkbutton.get()

            value_colorbutton.set_format(color_format, alone_when_single)

        color_format_option_menu.command = (
            alone_when_single_checkbutton.command
        ) = update_format

        ### finally store the subform list in the
        ### subform map
        self.subform_map["color_button"] = colorbutton_subform
Create form for color button arguments.
nodezator/editing/widgetpicker/subforms.py