As I recall, there are no color coding laws inside electronic devices at least in the USA, but there are international standards for color coding: wiring for autos, computers etc.,. Where a device interfaces to the electrical system [mains], color codes become mandated if the colors are visible; e.g. if you install a light fixture directly connected to mains not via a plug. Many device have no exposed wires but terminals where an electrician must wire the device to mains using color codes, and other things like gauges and right size terminal bolts, to your local code.
There are many electrical codes internationally that are essentially law as they are enforced by government, because there is a safety issue associated with the codes.
If an appliance is mis-made, where miswired is part of it, then that is a consumer protection issue enforced in the USA by the attorney general of each state.
Most codes require electrical device to have safety certification, like UL, ETL, etc., the NRTL groups in the USA, these NRTL labs enforce the international standard wiring conventions to the maker in order to have the safety 'mark'.
So, CE is truly caveat emptor
Now that said, a few responsible manufacturers resort to CE only in some markets to save development cost because they know a 3rd party safety certification or listing is not needed for sale in that region, and they know internally their devices conform to all safety and codes if required, so if they choose to resell it in another country and get certified, it will pass without problems.
For example, Fluke sells DMMs in China that are only CE but for sale only in countries were CE alone is acceptable. Many Japanese makers like Yogokawa, Hioki, Sanwa, do the same. Taiwan makers do so too, GWInstek, Pintek etc.,
FWIW a safety mark cost about $5000-$30,000 per device to get approval and thereafter, $2,000-3,000 per device annually to remain listed. Price varies with the complexity of the device and the agency, UL being the first and most expensive.
CE more should mean "Caveat Emptor".
Ha Ha , good one .
edited> add link> https://en.wikipedia.org/wiki/Electrical_wiring