I am trying to use this to figure out if a color is light or dark
Evaluate whether a HEX value is dark or light
Now. It takes in a int
int
The ranges of the R, G and B from the Color struct are 0-255.
R
G
B
To get the rgb value you expect in your function, you will need to left shift accordingly:
int rgb = (int)color.R << 16 + (int)color.G << 8 + color.B;