[−][src]Function photon_rs::colour_spaces::__wasm_bindgen_generated_desaturate_hsv
pub extern "C" fn __wasm_bindgen_generated_desaturate_hsv(
arg0: <PhotonImage as RefMutFromWasmAbi>::Abi,
arg1: <f32 as FromWasmAbi>::Abi
) -> <() as ReturnWasmAbi>::Abi
Desaturate the image by a specified amount in the HSV colour space.
Arguments
img
- A PhotonImage.level
- Float value from 0 to 1 representing the level to which to desaturate the image by. Thelevel
must be from 0 to 1 in floating-point,f32
format. Desaturating by 80% would be represented by alevel
of 0.8
Example
// For example to desaturate an image by 10% in the HSV colour space: use photon::color_spaces::desaturate_hsv; // Open the image. A PhotonImage is returned. let img: PhotonImage = open_image("images/mountains.PNG"); desaturate_hsv(&mut img, 0.1);