class_docstr: Accept color values in a variety of ways.
  
  * If a color is provided as a string, Bokeh determines whether this string
    represents one of the |named CSS colors| (such as "red"), a CSS4 color
    string (such as "rgb(0, 200, 0)"), or a hex value (such as "#00FF00").
  * If a 3-tuple is provided, it is treated as RGB values (between 0 and
    255).
  * If a 4-tuple is provided, it is treated as RGBA values (between 0 and
    255 for RGB and alpha as a float between 0 and 1).
  * If a 32-bit unsigned integer is provided, it is treated as RGBA values in
    a 0xRRGGBBAA byte order pattern.
  
  Example:
  
      .. code-block:: python
  
          >>> class ColorModel(HasProps):
          ...     prop = Color()
          ...
  
          >>> m = ColorModel()
  
          >>> m.prop = "firebrick"
  
          >>> m.prop = "#a240a2"
  
          >>> m.prop = (100, 100, 255)
  
          >>> m.prop = (100, 100, 255, 0.5)
  
          >>> m.prop = "junk"              # ValueError !!
  
          >>> m.prop = (100.2, 57.3, 10.2) # ValueError !!
class_docstr_tok: ["Accept","color","values","in","a","variety","of","ways",".","*","If","a","color","is","provided","as","a","string",",","Bokeh","determines","whether","this","string","represents","one","of","the","|named","CSS","colors|","(","such","as","``","red","''",")",",","a","CSS4","color","string","(","such","as","``","rgb","(","0",",","200",",","0",")","''",")",",","or","a","hex","value","(","such","as","``","#","00FF00","''",")",".","*","If","a","3-tuple","is","provided",",","it","is","treated","as","RGB","values","(","between","0","and","255",")",".","*","If","a","4-tuple","is","provided",",","it","is","treated","as","RGBA","values","(","between","0","and","255","for","RGB","and","alpha","as","a","float","between","0","and","1",")",".","*","If","a","32-bit","unsigned","integer","is","provided",",","it","is","treated","as","RGBA","values","in","a","0xRRGGBBAA","byte","order","pattern",".","Example",":","..","code-block",":",":","python",">",">",">","class","ColorModel","(","HasProps",")",":","...","prop","=","Color","(",")","...",">",">",">","m","=","ColorModel","(",")",">",">",">","m.prop","=","``","firebrick","''",">",">",">","m.prop","=","``","#","a240a2","''",">",">",">","m.prop","=","(","100",",","100",",","255",")",">",">",">","m.prop","=","(","100",",","100",",","255",",","0.5",")",">",">",">","m.prop","=","``","junk","''","#","ValueError","!","!",">",">",">","m.prop","=","(","100.2",",","57.3",",","10.2",")","#","ValueError","!","!"]
code: def transform(self, value: Any) -> Any:
      if isinstance(value, tuple):
          value = colors.RGB(*value).to_css()
      return value
  
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 3 for calling the Color obj's underlying member method code with example usage: obj.transform(value) and returns: value