Paint Xiaomi window door sensor


I have several window/door sensors from Xiaomi, but haven’t used them yet because of the color. They are white, while all doors/windows are dark green. I would like that they blend in. Is it possible to paint them or give then another color in another way?


I found a spray can lying around and tested it. It still works.