color/color.rs
1use xcursor_writer::{write, Image};
2
3fn main() {
4 let mut bgra = vec![];
5 for _y in 0..24 {
6 for _x in 0..24 {
7 bgra.push(0);
8 bgra.push(0);
9 bgra.push(255);
10 bgra.push(255);
11 }
12 }
13
14 let image = Image {
15 size: 24,
16 width: 24,
17 height: 24,
18 xhot: 12,
19 yhot: 12,
20 delay: 50,
21 pixels_bgra: bgra,
22 };
23
24 write(
25 &mut std::io::BufWriter::new(std::fs::File::create("red").unwrap()),
26 &[image],
27 &[],
28 )
29 .unwrap();
30}