@@ -939,28 +939,28 @@ def test_channel_color_ui_callbacks(
939939 assert len (channel_table .source .data ["channels" ]) == 5
940940
941941 # if no channels selected, check apply button does nothing
942- old_colors = color_table .source .data ["colors" ]
942+ old_colors = color_table .source .data ["colors" ]. copy ()
943943 click = ButtonClick (apply_button )
944944 apply_button ._trigger_event (click )
945945 assert color_table .source .data ["colors" ] == old_colors
946946
947- # select the first channel and set it to blue
947+ # select the first channel and set it to red
948948 channel_index = 0
949949 color_table .source .selected .indices = [channel_index ]
950- color_picker .color = "#0000ff "
950+ color_picker .color = "#ff0000 "
951951 channel_table .source .selected .indices = [channel_index ]
952952 click = ButtonClick (apply_button )
953953 apply_button ._trigger_event (click )
954954 assert color_table .source .data ["colors" ] != old_colors
955955
956- # check that getting a tile now blue
956+ # check that getting a tile now red
957957 tile = get_tile ("slide" , 0 , 0 , 0 , show = False ).astype (np .float32 )
958- sum_b = tile [:, :, 2 ].sum ()
959- sum_rg = tile [:, :, : 2 ].sum ()
960- assert sum_b > 0
961- # may be tiny non-zero r and g values due to webp compression
962- # but should be almost pure blue
963- assert sum_rg / (sum_b + 1e-5 ) < 0.05
958+ sum_r = tile [:, :, 0 ].sum ()
959+ sum_gb = tile [:, :, 1 : ].sum ()
960+ assert sum_r > 0
961+ # may be tiny non-zero g and b values due to webp compression
962+ # but should be almost pure red
963+ assert ( sum_gb ) / (sum_r + 1e-5 ) < 0.1
964964
965965
966966def test_enhance_slider_callback (
@@ -979,7 +979,7 @@ def test_enhance_slider_callback(
979979
980980 channel_index = 0
981981 color_table .source .selected .indices = [channel_index ]
982- color_picker .color = "#0000ff "
982+ color_picker .color = "#ff0000 "
983983 channel_table .source .selected .indices = [channel_index ]
984984 click = ButtonClick (apply_button )
985985 apply_button ._trigger_event (click )
0 commit comments