code: def test_validate_colors(self):
      # test string input
      color_string = "foo"
  
      pattern = (
          "If your colors variable is a string, it must be a "
          "Plotly scale, an rgb color or a hex color."
      )
  
      self.assertRaisesRegex(
          PlotlyError, pattern, colors.validate_colors, color_string
      )
  
      # test rgb color
      color_string2 = "rgb(265, 0, 0)"
  
      pattern2 = (
          "Whoops! The elements in your rgb colors tuples cannot "
          "exceed 255.0."
      )
  
      self.assertRaisesRegex(
          PlotlyError, pattern2, colors.validate_colors, color_string2
      )
  
      # test tuple color
      color_tuple = (1, 1, 2)
  
      pattern3 = (
          "Whoops! The elements in your colors tuples cannot "
          "exceed 1.0."
      )
  
      self.assertRaisesRegex(
          PlotlyError, pattern3, colors.validate_colors, color_tuple
      )
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_core/test_colors/test_colors.py
imports: from unittest import TestCase
  import plotly.tools
  from plotly.exceptions import PlotlyError
  import plotly.colors
label_desc: Use image node_id 1 for calling the TestColors obj's underlying member method code with example usage: obj.test_validate_colors() without return types