This commit is contained in:
Max Bradbury 2020-11-17 10:10:07 +00:00
parent 47a9bf5c79
commit 63bcf8532c
3 changed files with 14 additions and 0 deletions

View File

@ -78,6 +78,11 @@ html(lang="en-gb")
| dither
br
label
input#filter(type="checkbox")
| filter
br
button.pagination.prev#back-to-image previous
button.pagination.next#room-next add room
.page.download

View File

@ -8,6 +8,7 @@ import init, {
output,
set_brightness,
set_dither,
set_filter,
set_palette,
set_room_name,
} from './pkg/pixsy.js';

View File

@ -33,6 +33,7 @@ struct State {
room_name: Option<String>,
palette: SelectedPalette,
dither: bool,
filter: bool,
brightness: i32,
}
@ -44,6 +45,7 @@ lazy_static! {
room_name: None,
palette: SelectedPalette::None,
dither: true,
filter: false,
brightness: 0,
}
);
@ -131,6 +133,12 @@ pub fn set_dither(dither: bool) {
state.dither = dither;
}
#[wasm_bindgen]
pub fn set_filter(filter: bool) {
let mut state = STATE.lock().unwrap();
state.filter = filter;
}
#[wasm_bindgen]
pub fn set_palette(palette_id: &str, background: String, foreground: String) {
let mut state = STATE.lock().unwrap();