class_docstr: Test ability to marshall deck_gl_json_chart protos via st.map.
class_docstr_tok: ["Test","ability","to","marshall","deck_gl_json_chart","protos","via","st.map","."]
docstr: Test that users can pass colors in different formats.
docstr_tok: ["Test","that","users","can","pass","colors","in","different","formats","."]
code: def test_common_color_formats(self):
      """Test that users can pass colors in different formats."""
      df = pd.DataFrame(
          {
              "lat": [38.8762997, 38.8742997, 38.9025842],
              "lon": [-77.0037, -77.0057, -77.0556545],
              "tuple3_int_color": [
                  [255, 0, 0],
                  [0, 255, 0],
                  [0, 0, 255],
              ],
              "tuple4_int_int_color": [
                  [255, 0, 0, 51],
                  [0, 255, 0, 51],
                  [0, 0, 255, 51],
              ],
              "tuple4_int_float_color": [
                  [255, 0, 0, 0.2],
                  [0, 255, 0, 0.2],
                  [0, 0, 255, 0.2],
              ],
              "tuple3_float_color": [
                  [1.0, 0.0, 0.0],
                  [0.0, 1.0, 0.0],
                  [0.0, 0.0, 1.0],
              ],
              "tuple4_float_float_color": [
                  [1.0, 0.0, 0.0, 0.2],
                  [0.0, 1.0, 0.0, 0.2],
                  [0.0, 0.0, 1.0, 0.2],
              ],
              "hex3_color": ["#f00", "#0f0", "#00f"],
              "hex4_color": ["#f008", "#0f08", "#00f8"],
              "hex6_color": ["#ff0000", "#00ff00", "#0000ff"],
              "hex8_color": ["#ff000088", "#00ff0088", "#0000ff88"],
              "named_color": ["red", "green", "blue"],
          }
      )
  
      color_columns = sorted(set(df.columns))
      color_columns.remove("lat")
      color_columns.remove("lon")
  
      expected_values = {
          "tuple3": [[255, 0, 0], [0, 255, 0], [0, 0, 255]],
          "tuple4": [[255, 0, 0, 51], [0, 255, 0, 51], [0, 0, 255, 51]],
          "hex3": [
              [255, 0, 0, 255],
              [0, 255, 0, 255],
              [0, 0, 255, 255],
          ],
          "hex6": [
              [255, 0, 0, 255],
              [0, 255, 0, 255],
              [0, 0, 255, 255],
          ],
          # 88 in hex = 136
          "hex4": [
              [255, 0, 0, 136],
              [0, 255, 0, 136],
              [0, 0, 255, 136],
          ],
          "hex8": [
              [255, 0, 0, 136],
              [0, 255, 0, 136],
              [0, 0, 255, 136],
          ],
          "named": None,
      }
  
      def get_expected_color_values(col_name):
          for prefix, expected_color_values in expected_values.items():
              if col_name.startswith(prefix):
                  return expected_color_values
  
      for color_column in color_columns:
          expected_color_values = get_expected_color_values(
              color_column
          )
  
          if expected_color_values is None:
              with self.assertRaises(StreamlitAPIException):
                  st.map(df, color=color_column)
  
          else:
              st.map(df, color=color_column)
              c = json.loads(
                  self.get_delta_from_queue().new_element.deck_gl_json_chart.json
              )
  
              rows = c.get("layers")[0].get("data")
  
              for i, row in enumerate(rows):
                  self.assertEqual(
                      row[color_column], expected_color_values[i]
                  )
  
imports: import itertools
  import json
  import numpy
  import pandas
  import pytest
  from parameterized import parameterized
  import streamlit
  from streamlit.elements.map import _DEFAULT_MAP, _DEFAULT_ZOOM_LEVEL
  from streamlit.errors import StreamlitAPIException
  from tests.delta_generator_test_case import DeltaGeneratorTestCase
  from tests.streamlit import pyspark_mocks
  from tests.streamlit.snowpark_mocks import DataFrame
  from tests.streamlit.snowpark_mocks import Table
  from tests.testutil import create_snowpark_session, patch_config_options
label_desc: Use image node_id 5 for calling the StMapTest obj's underlying member method code with example usage: obj.test_common_color_formats() and returns: expected_color_values