code: def test_n_colors(self):
      # test that n_colors constrains values to between 0 and 255
      generated_colorscale = colors.n_colors(
          lowcolor="rgb(255,0,0)",
          highcolor="rgb(0,255,0)",
          n_colors=14,
          colortype="rgb",
      )
      expected_colorscale = [
          "rgb(255.0, 0.0, 0.0)",
          "rgb(235.3846153846154, 19.615384615384617, 0.0)",
          "rgb(215.76923076923077, 39.23076923076923, 0.0)",
          "rgb(196.15384615384613, 58.846153846153854, 0.0)",
          "rgb(176.53846153846155, 78.46153846153847, 0.0)",
          "rgb(156.9230769230769, 98.07692307692308, 0.0)",
          "rgb(137.3076923076923, 117.69230769230771, 0.0)",
          "rgb(117.69230769230768, 137.30769230769232, 0.0)",
          "rgb(98.07692307692307, 156.92307692307693, 0.0)",
          "rgb(78.46153846153845, 176.53846153846155, 0.0)",
          "rgb(58.84615384615384, 196.15384615384616, 0.0)",
          "rgb(39.230769230769226, 215.76923076923077, 0.0)",
          "rgb(19.615384615384585, 235.38461538461542, 0.0)",
          "rgb(0.0, 255.0, 0.0)",
      ]
  
      self.assertEqual(generated_colorscale, expected_colorscale)
  
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 8 for calling the TestColors obj's underlying member method code with example usage: obj.test_n_colors() without return types