Here is the blend file with the node group. Note it is for Blender 4.0.
https://1drv.ms/u/s!Ar9oADZiQciZ_shWbzMv473dw4zOgg?e=mKdscg
And here is an article I wrote explaining how I did it:
https://medium.com/@tdvance/create-a-procedural-hex-grid-in-blender-09fae96f5ca4
And some screen shots:
I learned material node editing form the Blender Material Nodes course, and I learned about Voronoi diagrams from https://link.springer.com/book/10.1007/978-1-4757-6568-7 (Sphere Packings, Lattices, and Groups by Conway and Sloane—yep, the same Conway who gave us Game of Life).