My engineering project colorblindness!

Hello! I'm currently in 8th grade, I have an engineering project due soon and would love some guides. Mines based on colorblindness, its using RBG as its color detect and can only detect the colors red and green.. Most of the colors aren't red or green lol. Anyways! I don't want to delete my WHOLE CODE.. But I'm trying to make something more accurate, I'm trying to figure out a way to use HSL.. (Hue, saturation, lightness) please! If any tips would be appreciated! My goal is to make state! Please any recommendations, guides, tips leave them down below. Thank you!!

What do you mean? Do you have a color sensor that returns an RGB value?
Explain a little more your project...