I've been trying to create predefined classes several times in different languages but I couldn't find out how.
This is one of the ways I tried it:
public class Color{
public float r;
public float r;
public float r;
public Color(float _r, float _g, float _b){
r = _r;
g = _g;
b = _b;
}
public const Color red = new Color(1,0,0);
}
This is in C# but I need to do the same in Java and C++ too so unless the solution is the same I would like to know how to do it in all of those.
EDIT: that code did not work, so the question was for all three languages.I got working answers for C# and Java now and I guess C++ works the same way, so thanks!