Color codes in wiring are regulated by ISO IEC 60445: 2017 "Basic and safety principles for man-machine interface, marking and identification - Identification of equipment terminals, conductor terminations and conductors".
IEC 60445:2017 applies to the identification and marking of terminals
of electrical equipment such as resistors, fuses, relays, contactors,
transformers, rotating machines and, wherever applicable, to
combinations of such equipment (e.g. assemblies), and also applies to
the identification of terminations of certain designated conductors.
It also provides general rules for the use of certain colours or
alphanumeric notations to identify conductors with the aim of avoiding
ambiguity and ensuring safe operation. These conductor colours or
alphanumeric notations are intended to be applied in cables or cores,
busbars, electrical equipment and installations. This basic safety
publication is primarily intended for use by technical committees in
the preparation of standards in accordance with the principles laid
down in IEC Guide 104 and ISO/IEC Guide 51. It has the status of a
basic safety publication in accordance with IEC Guide 104. This sixth
edition cancels and replaces the fifth edition of IEC 60445, published
in 2010.
In EU - and surely in Italy, were I live - standard norms issued by ISO, EN and UNI (Italian National Standards Organization) have force of law, and whoever wants to build anything must comply with all relevant and applicable standard norms.
In particular, compliancy with safety publications is strictly mandatory. Failure to comply will certainly lead to liability and prosecution in case of damages and/or injuries, not to mention death.
So, the answer is, "yes, wire colors matter in electronics"