How does OpenLayers change the feature style?

for example, now that there is a feature that is red, how can I change its style?
I use feature.getStyle (). GetImage (). GetFill (). SetColor ("blue");
the color item of printing feature has turned blue, but it is still red. Why?
how can I change the color of feature? The premise is that there is a large amount of feature. I don"t know if he is a triangle or a circle or something, so I can"t write a new style

directly.
Mar.28,2021

you need to update the view after setting the color

Layer.changed()

Layer.getSource().changed()
Menu