Skip to content

How does iced use tiny_skia on an Xrgb buffer? #1915

Answered by hecrj
StratusFearMe21 asked this question in Q&A
Discussion options

You must be logged in to vote

softbuffer uses a BGRX buffer. We just swap the r and b color components when drawing with tiny-skia:

fn into_color(color: Color) -> tiny_skia::Color {
tiny_skia::Color::from_rgba(color.b, color.g, color.r, color.a)
.expect("Convert color from iced to tiny_skia")
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@StratusFearMe21
Comment options

Answer selected by StratusFearMe21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants