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: rainbowimage.rs
    path of file: ./repos/rusty_art/src
    
    the code of the file until where you have to start completion: 
//inspired by Roni Kaufman, https://ronikaufman.github.io/
use nannou::image::{open, DynamicImage, GenericImageView, Rgba};
use nannou::prelude::*;
use nannou::wgpu::Texture;
use std::path::PathBuf;
use nannou_eg
    
fn update(app: &App, model: &mut Model, _update: Update) {
    let egui = &mut model.egui;
    let settings = &mut model.settings;
    egui.set_elapsed_time(_update.since_start);
    let ctx = egui.begin_frame();
    egui::Window::new("Settings").show(&ctx, |ui| {
        ui.label(format!("color {}", settings.colors));
        ui.label(format!("speed {}", settings.speed));
        ui.add(egui::Slider::new(&mut settings.speed, 0.0..=1000.0).text("speed"));
        ui.add(egui::Slider::new(&mut settings.pixel_size, 1..=30).text("Pixel size"));
        if ui.button("next").clicked() {
            settings.colors = (settings.colors % 3) + 1;
            settings.sort_order = (settings.sort_order + 1) % 3; 
        }
        ui.add(egui::Checkbox::new(&mut settings.use_real_colors, "Use Real Colors"));
        if ui.button("Restart").clicked() {
            model.draw_count = 0;
        }
    });
    if model.draw_count < model.img.width() * model.img.height() {
        model.draw_count += model.settings.speed as u32;
    }
    model.texture = Some(Texture::from_image(app, &model.img));
}