Skip to content

Conversation

Yoppez
Copy link
Contributor

@Yoppez Yoppez commented May 17, 2025

The most part is copied from Rust-SDL2/rust-sdl2#1472, with the needed edits and additions (like FColor).

impl From<FColor> for Color {
fn from(val: FColor) -> Color {
Color {
r: (val.r * 255.) as u8,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe these should be rounded instead of truncated?

Copy link
Contributor Author

@Yoppez Yoppez May 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right. I also thought to check the boundaries, so it becomes something like
r: (val.r * 255.).round().clamp(0., 255.) as u8,

@revmischa revmischa merged commit d57ce1b into vhspace:master May 18, 2025
3 checks passed
@revmischa
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants