<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def console_fill_foreground( con: tcod.console.Console, r: Sequence[int], g: Sequence[int], b: Sequence[int], ) -> None: """Fill the foregound of a console with r,g,b. Args: con (Console):
 Any Console instance. r (Sequence[int]):
 An array of integers with a length of width*height. g (Sequence[int]):
 An array of integers with a length of width*height. b (Sequence[int]):
 An array of integers with a length of width*height. .. deprecated:: 8.4 You should assign to :any:`tcod.console.Console.fg` instead. """

    if len(r) != len(g) or len(r) != len(b):
        raise TypeError("R, G and B must all have the same size.")
    if (
        isinstance(r, np.ndarray)
        and isinstance(g, np.ndarray)
        and isinstance(b, np.ndarray)
    ):
        # numpy arrays, use numpy's ctypes functions
        r_ = np.ascontiguousarray(r, dtype=np.intc)
        g_ = np.ascontiguousarray(g, dtype=np.intc)
        b_ = np.ascontiguousarray(b, dtype=np.intc)
        cr = ffi.cast("int *", r_.ctypes.data)
        cg = ffi.cast("int *", g_.ctypes.data)
        cb = ffi.cast("int *", b_.ctypes.data)
    else:
        # otherwise convert using ffi arrays
        cr = ffi.new("int[]", r)
        cg = ffi.new("int[]", g)
        cb = ffi.new("int[]", b)

    lib.TCOD_console_fill_foreground(_console(con), cr, cg, cb)