/test/language/expanded/color.e
Specman e | 63 lines | 32 code | 10 blank | 21 comment | 0 complexity | 640e261ba7e21672fb5f18133e929e2f MD5 | raw file
1-- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries. 2-- See the Copyright notice at the end of this file. 3-- 4expanded class COLOR 5 6insert 7 ANY 8 redefine out 9 end 10 11create {ANY} 12 default_create, make_rgb 13 14feature {ANY} 15 make_rgb (r, g, b: INTEGER_8) 16 do 17 red := r 18 green := g 19 blue := b 20 alpha := 0 21 end 22 23 to_integer_32: INTEGER_32 24 do 25 Result := alpha.to_integer_32 26 Result := red.to_integer_32 27 Result := green.to_integer_32 28 Result := blue.to_integer_32 29 end 30 31 out: STRING 32 do 33 Result := alpha.out + red.out + green.out + blue.out + to_integer_32.to_hexadecimal 34 end 35 36feature {ANY} 37 red: INTEGER_8 38 39 green: INTEGER_8 40 41 blue: INTEGER_8 42 43 alpha: INTEGER_8 44 45end -- class COLOR 46-- 47-- ------------------------------------------------------------------------------------------------------------------------------ 48-- Copyright notice below. Please read. 49-- 50-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, 51-- as published by the Free Software Foundation; either version 2, or (at your option) any later version. 52-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty 53-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have 54-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free 55-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 56-- 57-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE 58-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE 59-- 60-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN 61-- 62-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr 63-- ------------------------------------------------------------------------------------------------------------------------------