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: texture_to_file.rs
    path of file: ./repos/notan/examples
    
    the code of the file until where you have to start completion: use notan::draw::*;
use notan::prelude::*;

const BUTTON_SIZE: f32 = 25.0;
const MARGIN_X: f32 = 50.0;
const MARGIN_Y: f32 = 50.0;
const WIDTH: f32 = 700.0;
const HEIGHT: f32 = 500.0;

struct ColorButton {
    color: Color,
    x: f32,
    y: f32,
    selected: bool,
}

impl ColorButton {
    fn draw(&self, draw: &mut Draw) {
        draw.rect((self.x, self.y), (BUTTON_SIZE, BUTTON_SIZE))
            .color(self.color)
            .alpha(0.7);

        draw.rect((self.x, self.y), (BUTTON_SIZE, BUTTON_SIZE))
            .color(Color::WHITE)
            .stroke(2.0);

        if self.selected {
            draw.rect(
                (s
    
    fn new(gfx: &mut Graphics) -> Self {
        // create the render texture
        let rt = gfx
            .create_render_texture(WIDTH as _, HEIGHT as _)
            .with_filter(TextureFilter::Linear, TextureFilter::Linear)
            .build()
            .unwrap();

        let font = gfx
            .create_font(include_bytes!("./assets/kenney_pixel-webfont.ttf"))
            .unwrap();

        // clear the texture with white
        {
            let mut draw = rt.create_draw();
            draw.clear(Color::WHITE);
            draw.text(&font, "Draw here!")
                .size(70.0)
                .color(Color::BLACK)
                .alpha(0.15)
                .v_align_middle()
                .h_align_center()
                .position(350.0, 250.0);

            gfx.render_to(&rt, &draw);
        }

        // colors to use
        let color_base = [
            Color::BLACK,
            Color::GRAY,
            Color::RED,
            Color::GREEN,
            Color::BLUE,
            Color::MAGENTA,
            Color::ORANGE,
            Color::YELLOW,
        ];

        let xx = 400.0 - (color_base.len() as f32 * (BUTTON_SIZE + 10.0)) * 0.5;
        let yy = 10.0;

        let colors: Vec<ColorButton> = color_base
            .iter()
            .enumerate()
            .map(|(i, c)| {
                let n = i as f32;

                ColorButton {
                    x: xx + n * (BUTTON_SIZE + 10.0),
                    y: yy,
                    color: *c,
                    selected: i == 0,
                }
            })
            .collect();

        Self {
            rt,
            last_x: 0.0,
            last_y: 0.0,
            colors,
            color: Color::BLACK,
            font,
        }
    }