class_docstr: Set color scheme event
class_docstr_tok: ["Set","color","scheme","event"]
code: def to_odm(self):
      fields = (
          [asdict(field) for field in self.color_scheme.fields]
          if self.color_scheme.fields
          else None
      )
      colorscales = (
          [
              asdict(colorscales)
              for colorscales in self.color_scheme.colorscales
          ]
          if self.color_scheme.colorscales
          else None
      )
      default_mask_targets_colors = (
          [
              asdict(target)
              for target in self.color_scheme.default_mask_targets_colors
          ]
          if self.color_scheme.default_mask_targets_colors
          else None
      )
      default_colorscale = (
          asdict(self.color_scheme.default_colorscale)
          if self.color_scheme.default_colorscale
          else None
      )
      label_tags = (
          asdict(self.color_scheme.label_tags)
          if self.color_scheme.label_tags
          else None
      )
  
      return foo.ColorScheme(
          color_pool=self.color_scheme.color_pool,
          color_by=self.color_scheme.color_by,
          fields=fields,
          default_mask_targets_colors=default_mask_targets_colors,
          label_tags=label_tags,
          colorscales=colorscales,
          default_colorscale=default_colorscale,
          multicolor_keypoints=self.color_scheme.multicolor_keypoints,
          opacity=self.color_scheme.opacity,
          show_skeletons=self.color_scheme.show_skeletons,
      )
  
imports: import base64
  from dataclasses import asdict, dataclass
  import re
  import typing
  import asyncio
  from bson import json_util
  from dacite import from_dict
  import eta.core.serial
  import eta.core.utils
  import fiftyone.core.odm.dataset
  import fiftyone.core.state
  from fiftyone.core.utils import lazy_import, run_sync_task
label_desc: Use image node_id 2 for calling the SetColorScheme obj's underlying member method code with example usage: obj.to_odm() and returns: foo