Just to be able to mark the question as solved, here is a short answer to this from the comments:
To transfer a color attribute from Geometry Nodes to the Shader, a corresponding attribute must be created.
This can either be passed directly to the Group Output (as seen in your screenshot), or an attribute can be explicitly created with the node Store Named Attribute
.
Here you have two options.
Either you create the attribute and read it in the shader with the node Attribute
:
Or you create a Color Attribute beforehand, store your color there, and read this attribute with the node Color Attribute
:
In addition, a material must be assigned to the created geometry with Set Material
!