IF your message was expected to go via iMessage (blue) but instead goes
SMS (green) ~ check Settings for Messages in iDevices & see if iMessage
was somehow turned off.
(my choice of words may be imprecise but I wasn't expecting what I found
and didn't take any notes; was looking for something out of place, to fix.)
Mine mysteriously was sending text SMS between Apple product users; and
the setting also affected my Apple device hand-off. Text via iPhone from iPad
would not send, until I found this. Still not sure what the cause; hadn't updated.
So 'unexpected text message colors' may imply another cause; a symptom, instead.
The Mac, iPhone SE, and iPad Mini usually get their location refreshed by use of
Find My Mac (in iPhone) as they all appear there, when within range. This can help
be sure they 'hand-off' to share wi-fi and other features; when logged into iCloud.
PS: after posting I see a good example above of what I found unexpectedly caused
the Green message SMS, when Blue iMessage had been a common feature in mine.