[−][src]Function photon::channels::selective_hue_rotate
pub fn selective_hue_rotate(
photon_image: &mut PhotonImage,
ref_color: Rgb,
degrees: f32
)
Selective hue rotation.
Only rotate the hue of a pixel if its RGB values are within a specified range. This function only rotates a pixel's hue to another if it is visually similar to the colour specified. For example, if a user wishes all pixels that are blue to be changed to red, they can selectively specify only the blue pixels to be changed.
Arguments
img
- A PhotonImage.ref_color
- TheRGB
value of the reference color (to be compared to)degrees
- The amount of degrees to hue rotate by.
Example
// For example, to only rotate the pixels that are of RGB value RGB{20, 40, 60}: let ref_color = Rgb{20, 40, 60}; photon::channels::selective_hue_rotate(&mut img, ref_color, 180);