[][src]Function photon_rs::colour_spaces::__wasm_bindgen_generated_saturate_hsl

pub extern "C" fn __wasm_bindgen_generated_saturate_hsl(
    arg0: <PhotonImage as RefMutFromWasmAbi>::Abi,
    arg1: <f32 as FromWasmAbi>::Abi
) -> <() as ReturnWasmAbi>::Abi

Increase the image's saturation by converting each pixel's colour to the HSL colour space and increasing the colour's saturation.

Arguments

  • img - A PhotonImage.
  • level - Float value from 0 to 1 representing the level to which to increase the saturation by. The level must be from 0 to 1 in floating-point, f32 format. Increasing saturation by 80% would be represented by a level of 0.8

Example

// For example to increase saturation by 10% in the HSL colour space:
use photon::color_spaces::saturate_hsl;
 
// Open the image. A PhotonImage is returned.
let img: PhotonImage = open_image("images/flowers.PNG");
 
saturate_hsl(&mut img, 0.1);