class_docstr: ref Color
  
  The only difference to Color is that this class transforms values into
  hexadecimal strings to be sent to BokehJS.
class_docstr_tok: ["ref","Color","The","only","difference","to","Color","is","that","this","class","transforms","values","into","hexadecimal","strings","to","be","sent","to","BokehJS","."]
code: def transform(self, value: Any) -> Any:
      if isinstance(value, str):
          value = value.lower()
          if value.startswith("rgb"):
              match = re.findall(r"[\d\.]+", value)
              a = float(match[3]) if value[3] == "a" else 1.0
              value = colors.RGB(
                  int(match[0]), int(match[1]), int(match[2]), a
              ).to_hex()
          elif value in enums.NamedColor:
              value = getattr(colors.named, value).to_hex()
      elif isinstance(value, tuple):
          value = colors.RGB(*value).to_hex()
      else:
          value = value.to_hex()
      return value.lower()
  
imports: from __future__ import annotations
  import logging
  import re
  from typing import Any
  from ...None import colors
  from ..None import enums
  from .bases import Init, Property
  from .container import Tuple
  from .either import Either
  from .enum import Enum
  from .numeric import Byte, Percent
  from .singletons import Undefined
  from .string import Regex
label_desc: Use image node_id 1 for calling the ColorHex obj's underlying member method code with example usage: obj.transform(value) and returns: value