You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: colors.rs
    path of file: ./repos/cursive/cursive/examples
    
    the code of the file until where you have to start completion: use cursive::theme::{Color, ColorStyle};
use cursive::view::Resizable;
use cursive::views::Canvas;
use cursive::Printer;

// This example will draw a colored square with a gradient.
//
// We'll use a Canvas, which lets us only de
    
fn back_color(x: u8, y: u8, x_max: u8, y_max: u8) -> Color {
    // Let's try to have a gradient in a different direction than the front color.
    Color::Rgb(
        128 + (2 * y_max + x - 2 * y) * (128 / (x_max + 2 * y_max)),
        255 - y * (255 / y_max),
        255 - x * (255 / x_max),
    )
}