[][src]Function photon_rs::colour_spaces::darken_hsv

pub fn darken_hsv(img: &mut PhotonImage, level: f32)

Darken the image's colours 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 darken the image by. The level must be from 0 to 1 in floating-point, f32 format. Darkening by 80% would be represented by a level of 0.8

Example

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