How to define colours to syntax defined in grammars? provides a guide how to create a grammar as in here:
But they do not say anything how to define the colours for defined syntaxes (say a keyword). How do we define those?

Grammars don’t define the colours
See making a syntax theme

I also suggest looking at exisitng syntax themes for examples


What about markdown rendering? I mean when you press ctrl+shift+m; for example say you want to change the colour of # headings…

You could look at the package source, or use dev tools to see the selectors. That’s just general CSS though, so it’s not going to be covered in an Atom guide.