You need to ensure that your website/product is accessible to people with a diverse range of hearing, movement, sight, and cognitive ability. That’s what Web Content Accessibility Guidelines are for. WCAG 2.0 standard for color contrast is a 4.5:1 ratio between foreground (i.e. text, images) and background.

Check your contrast ratio with this tool:

Contrast Checker