If hes got lots of colour code i expect it'd mount up, but he'd have a have a serious amount of code dealing with colours.
Code size shouldn't really be a concern. if you can make the code smaller by making longer functions into smaller ones thats usually good because its code re-use. Smaller code in itself is a pointless goal if it takes longer to read. Afterall the compiler really doesn't care how long the code it only how correct it is, and the more direct you are in your code the less instructions dealing with indirection will be created (before any compiler optimisation of course).
Is your goal to be able to cycle through colors for users to pick from, without having to know the "color.auqa" value and so forth? The system refers to colors as color instances or static values, but not as numeric values in the traditional sense. Can you give a short example of what you are trying to do and a short code segment that you propose? I ran into the same problem with colors until I became more familiar with .NET and object-oriented programming.
Colors are Structures, and in each color structure, you can get any of the list of available colors.
Here are two ways to use a number to get a color.
The first way would be to use Color.FromArgb(number).
The number you specify will be transformed into a color. It is easier to understand your number if you put it in the function by a hexadecimal value.
&H3258A288
This will be a color with &H88 in the Red channel, &HA2 in the Green channel, and &H58 in the Blue channel, and &H32 in the Alpha channel.
The other would be to make an array of color structures.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.