Changing CPU particle colors using script

Godot Version

4.3

Question

My player character creates a small “dust” effect when landing on a surface. How do I change the color of the particles with a script?

You can change the .color of your particles

func _ready() -> void:
    $CPUParticles2D.color = Color(randf(), randf(), randf())