WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

map_colors is not a full replacement for map_rgb #137

@kornelski

Description

@kornelski

map_rgb on RGBA<T, A> uses a From for the A type to make it match T, allowing code like px.map_colors(|c| c as f32 * px.a as f32) to just work and update alpha.

map_colors is just for the colors, and results in an annoying RGBA<f32, u8>.

https://docs.rs/rgb/0.8.90-alpha.2/rgb/trait.HetPixel.html#tymethod.map_colors

Should it also convert alpha? Should there be another method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions