Skip to content
Snippets Groups Projects
Commit 9024977f authored by Christophe Rhodes's avatar Christophe Rhodes
Browse files

implement first bullet point of question 2

Just classes and constructors
parents
Branches
No related merge requests found
lab4.pde 0 → 100644
class sRGB {
float r, g, b;
sRGB(color c) { }
sRGB(float _r, float _g, float _b) {
r = _r;
g = _g;
b = _b;
}
String toString() {
return "<sRGB r: " + r + " g: " + g + " b: " + b + ">";
}
}
class XYZ {
float x, y, z;
XYZ(float _x, float _y, float _z) {
x = _x;
y = _y;
z = _z;
}
String toString() {
return "<XYZ x: " + x + " y: " + y + " z: " + z + ">";
}
}
void setup () {
XYZ c;
c = new XYZ(1.0, 1.0, 1.0);
println(c);
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment