For DC powered circuits, red is generally used to indicate positive. The other black is the color for negative.
For balanced dual-power circuits the red color is positive and black is mass, or GND, or whatever it’s known as blue and red is negative.
Circuits that have high weight (so positive power) typically use the combination of a GND linked red black instead of black/blue pair.
There is no “legal regulation” simply a standard convention. Make sure to check the voltage with a voltmeter in case you’re not sure.
In AC there are rules that are in place, however they could vary from one country to the next So, check local laws: for instance, Europe tend to use blue as “neutral” (grounded at distribution) black as “phase” (sustaining the voltage) and “green/yellow stripes” as “safety grounding”. However, I’m sure there are areas that use the reverse!