Color Indicator for rows in a child table

Hello guys,

I need to indicate rows in a child table with a condition :
if the field “contract_expiry_date” is 30 days or below the color should be red ,
if the field “contract_expiry_date” is 40 days or below the color should be orange , and ,
if the field “contract_expiry_date” is 45 days or below the color should be yellow .

Kindly do help …