Only very few actions are commonly associated with a specific color. These four "colors" (counting gray as a color for sake of simplicity in wording) are examples for those that can induce an understanding of what an UI element does just by the color:
- Red for ending: cancel (end the action), delete (end the existance), close (end the application/popup), hang up (end the call) to name the most common ones.
- Green for approval: accept call, confirm action.
- Blue font for hyperlinks
- Gray for a disabled state
For login or register, there are no common colors (at least as far as I know). So rather than trying to use the color to describe the action, just use the difference of colored vs. not colored, where the color should be the defining color of your theme.
In general, only color one "default" button per view. The default button is the one that people are usually going to use (in a psychological way, you could also argue it is the one you want the people to use).
For the login form, that would be "Login", since you register once but login every time. Hence, the color of the register button should be "none" (just a link or a white button, if you want to stick with a button), whereas the color of your login button is dependent on your "corporate design".
Aside from all that, I'd like to highlight one general aspect of coloring, especially since the "random" design you provided is the best example for it:
At all times, keep in mind that roughly 5% of any user group are color blind. For your example, those people would see two gray buttons.