Function photon_rs::colour_spaces::lighten_hsv
source · pub fn lighten_hsv(img: &mut PhotonImage, level: f32)
Expand description
Lighten an 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 lighten the image by. Thelevel
must be from 0 to 1 in floating-point,f32
format. Lightening by 80% would be represented by alevel
of 0.8
Example
// For example to lighten an image by 10% in the HSV colour space:
use photon_rs::colour_spaces::lighten_hsv;
use photon_rs::native::open_image;
// Open the image. A PhotonImage is returned.
let mut img = open_image("img.jpg").expect("File should open");
lighten_hsv(&mut img, 0.1_f32);