I want to be able to store a backgroundcolor for a panel in my application in the database.
The value can be either a concrete color or empty, indicating it has been inherited from the parent.
I wanted to store this in an int-field that is non-nullable, by calling the System.Drawing.Color.ToArgb() method.
The return value of this method seems to be -1 for white, and -16777216 for black...
So I was thinking that for indicating the no color has been selected, I could store a positive integer. This would offer a very simple way to check whether an explicit color has been stored or no color has been stored.
Now I was wondering whether there is a legimitate reason why System.Drawing.Color.ToArgb() could ever return positive values. (What's the range of possible return values for this function).
I haven't been tampering around with the alpha channel, so I don't know whether that would have influence....
If I'm not able to store a positive integer to indicate the abscence of an explicit color, I guess I will just have to make the field nullable....