func init // adds using namespace sys.add_use('ColorMine.ColorSpaces') // adds assembly sys.add_assembly('ColorMine', 'ColorMine.dll') // initialize instance sys.add_object(this.codename, 'Rgb') if(not (isdef("R") and isdef("G") and isdef("B"))) blk_init.println(this.codename, ' = new Rgb { R = ', this.props("R").value, 'f, G = ', this.props("G").value, 'f, B = ', this.props("B").value, 'f } ;') end // make methods for the fields sys._prop_init('R', 1, 1, 7) sys._prop_init('G', 1, 1, 7) sys._prop_init('B', 1, 1, 7) // makes implementation of methods as properties sys._mtd_as_prop_init('Rgb') end func doFromSample(data) dt = d("Sample") blk.println(this.codename, ' = new Rgb { R = ', dt, '[0], G = ', dt, '[1], B = ', dt, '[2] } ;') end