Please paste your CSS in here so we can see what you did. To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key.
So there is a contrast function in CSS but it’s for images, not text. You want to use the color property, you just want to make sure the color you choose has enough contrast with the dark background to be accessible. The color you chose is not quite light enough. The hint is giving you a color that would work.