#NEWLINE# def console_fill_foreground( con , r , g , b ) : #NEWLINE# #INDENT# if ( ( len ( r ) != len ( g ) ) or ( len ( r ) != len ( b ) ) ) : #NEWLINE# #INDENT# raise TypeError ( 'R, G and B must all have the same size.' ) #NEWLINE# #UNINDENT# if ( numpy_available and isinstance ( r , numpy . ndarray ) and isinstance ( g , numpy . ndarray ) and isinstance ( b , numpy . ndarray ) ) : #NEWLINE# #INDENT# r = numpy . ascontiguousarray ( r , dtype = numpy . int32 ) #NEWLINE# g = numpy . ascontiguousarray ( g , dtype = numpy . int32 ) #NEWLINE# b = numpy . ascontiguousarray ( b , dtype = numpy . int32 ) #NEWLINE# cr = r . ctypes . data_as ( POINTER ( c_int ) ) #NEWLINE# cg = g . ctypes . data_as ( POINTER ( c_int ) ) #NEWLINE# cb = b . ctypes . data_as ( POINTER ( c_int ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cr = ( c_int * len ( r ) ) ( * r ) #NEWLINE# cg = ( c_int * len ( g ) ) ( * g ) #NEWLINE# cb = ( c_int * len ( b ) ) ( * b ) #NEWLINE# #UNINDENT# _lib . TCOD_console_fill_foreground ( con , cr , cg , cb )