@@ -939,29 +939,29 @@ 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" ]
943- color_picker .color = "#ff0000 "
942+ old_colors = color_table .source .data ["colors" ]. copy ()
943+ color_picker .color = "#ffff00 "
944944 click = ButtonClick (apply_button )
945945 apply_button ._trigger_event (click )
946946 assert color_table .source .data ["colors" ] == old_colors
947947
948- # select the first channel and set it to blue
948+ # select the first channel and set it to red
949949 channel_index = 0
950950 color_table .source .selected .indices = [channel_index ]
951- color_picker .color = "#0000ff "
951+ color_picker .color = "#ff0000 "
952952 channel_table .source .selected .indices = [channel_index ]
953953 click = ButtonClick (apply_button )
954954 apply_button ._trigger_event (click )
955955 assert color_table .source .data ["colors" ] != old_colors
956956
957- # check that getting a tile now blue
957+ # check that getting a tile now red
958958 tile = get_tile ("slide" , 0 , 0 , 0 , show = False ).astype (np .float32 )
959- sum_b = tile [:, :, 2 ].sum ()
960- sum_rg = tile [:, :, : 2 ].sum ()
961- assert sum_b > 0
962- # may be tiny non-zero r and g values due to webp compression
963- # but should be almost pure blue
964- assert sum_rg / (sum_b + 1e-5 ) < 0.05
959+ sum_r = tile [:, :, 0 ].sum ()
960+ sum_gb = tile [:, :, 1 : ].sum ()
961+ assert sum_r > 0
962+ # may be tiny non-zero g and b values due to webp compression
963+ # but should be almost pure red
964+ assert ( sum_gb ) / (sum_r + 1e-5 ) < 0.1
965965
966966
967967def test_enhance_slider_callback (
@@ -980,7 +980,7 @@ def test_enhance_slider_callback(
980980
981981 channel_index = 0
982982 color_table .source .selected .indices = [channel_index ]
983- color_picker .color = "#0000ff "
983+ color_picker .color = "#ff0000 "
984984 channel_table .source .selected .indices = [channel_index ]
985985 click = ButtonClick (apply_button )
986986 apply_button ._trigger_event (click )
0 commit comments