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()
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e46c00-43914.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e46c00-43914.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?