def import_colors(self):
        """Import colors from python literals in path(s)."""

        ### retrieve path(s) from file browser
        paths = select_paths(caption="Select path(s)")

        ### if a path or list of paths was not returned,
        ### just exit the method by returning
        if not paths:
            return

        ### otherwise, load and set colors

        try:
            colors = sum(
                (
                    custom_format_color(
                        load_pyl(path),
                        "rgb_tuple",
                        False,
                    )
                    for path in paths
                ),
                (),
            )

        ## inform user if error occur

        except Exception as err:

            log_message = "An error ocurred while loading colors."

            logger.exception(log_message)
            USER_LOGGER.exception(log_message)

            dialog_message = log_message + (
                " For more info check the user log (on the graph/canvas, press"
                " <Ctrl+Shift+j> or access the \"Help > Show user log\" option"
                " on the menubar)."
            )

            create_and_show_dialog(dialog_message, level_name='error')

        else:

            ### set the colors into the colors panel
            self.set_colors(colors)
Import colors from python literals in path(s).
nodezator/colorsman/editor/panel/data.py