Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (12 sloc) 371 Bytes
An.object().named('Graphic').plural('Graphics').from(Widget).
has('red',0).
has('green',0).
has('blue', 0).
has('alpha',1.0).
does('color', function(R,G,B,A) {
return this.
has('red',Math.min(255,Math.max(0,1*R))).
has('green',Math.min(255,Math.max(0,1*G))).
has('blue',Math.min(255,Math.max(0,1*B))).
has('alpha',Math.min(1.0, Math.max(0,1*A)))
})