Use Power automate flow to get the list item attachments using Get attachments action and then update the list column accordingly. You can run this flow as automated flow (when item created/modified) or scheduled flow (daily or 2 times a day, etc.) as per your requirements.
Available options to change the cell color:
Once you have the count of item attachments in the list column, you can easily color code it using JSON formatting.
SPFx field customizer: If you are developing field customizer solution for getting the count of list item attachments, you can color code the cell using field customizer as you have full control of UI using custom code.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.