By default, there is no way to change font and background colors in Notion to whatever color you want. There is a set of color list given by default in Notion like this, but you cannot go beyond this list:
You can either change font color, or the font background color.
There is a workaround, though.
Change Font and Background Colors in Notion
Here’s the format code to use to change font color and the font background color simultaneously:
$$\color{color code}\colorbox{color code}{enter your text}$$
I created a GIF to show how to use it in your Notion:
If you want to just change background color and not the font color, use this format:
$$\colorbox{color code}{enter your text}$$
Every character given in the above code is important and to be entered without spaces, to get the color change effect.
You may also like: How To Download GIFs With Sound Easily