code: def test_to_rgba():
      color = (0.5, 0.25, 0.75)
      opacity = 0.8
      expected_output = "rgba(127,63,191,0.8)"
  
      assert _to_rgba(color) == "rgba(127,63,191,1.0)"
      assert _to_rgba(color, opacity) == expected_output
  
      # Test edge cases
      assert _to_rgba((0, 0, 0)) == "rgba(0,0,0,1.0)"
      assert _to_rgba((1, 1, 1)) == "rgba(255,255,255,1.0)"
      assert _to_rgba((0.333, 0.666, 1.0), 0) == "rgba(84,169,255,0)"
  
imports: import pandas
  import numpy
  import pytest
  from pdpbox.utils import FeatureInfo, _to_rgba, _check_col, _check_dataset, _make_list, _check_model, _check_classes, _check_memory_limit, _check_frac_to_plot, _calc_n_jobs, _get_string, _expand_params_for_interact, _calc_preds, _check_cluster_params, _check_plot_engine, _check_pdp_interact_plot_type
label_desc: Use image node_id 1 for calling a global function with example usage: test_to_rgba() without return types