Components / ColorPair

ColorPair

Foreground and background colors, one over the other, with a swap button.

Example

The component itself, running in WebAssembly, beside its code in a playground. Try it.

Code

use ravenrs::prelude::*;

fn color_pair() -> impl View {
    let (front, back) = (State::new(Color::hex(0xe11d48)), State::new(Color::WHITE));
    ColorPair::new(front.binding(), back.binding()).defaults(Color::BLACK, Color::WHITE)
}

Open in the playground, with every example →

Full API of ColorPair →