win_magnification.effects
Aug 11, 2023
Color effects (color transformation matrices)
Inspired by:
windows color filters
Author: MaxBQb
- inversion(value=1.0) types.ColorMatrix [source]
- Invert colors (black -> white, white -> black)Uses
get_transition()
- Parameters
value – Power of effect applied
- Returns
Color inversion effect matrix
- grayscale(value=1.0) types.ColorMatrix [source]
- All colors become shades of grayUses
get_transition()
- Parameters
value – Power of effect applied
- Returns
Color grayscale effect matrix
- sepia(value=1.0) types.ColorMatrix [source]
- All colors become shades of brownUses
get_transition()
- Parameters
value – Power of effect applied
- Returns
Color sepia effect matrix
- contrast(value=1.0) types.ColorMatrix [source]
-
>>> tools.print_matrix(contrast()) 1.2 0.0 0.0 0.0 -0.2 0.0 1.2 0.0 0.0 -0.2 0.0 0.0 1.2 0.0 -0.2 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0
- Parameters
value – Power of effect applied
- Returns
Color sepia effect matrix
- binary(value=1) types.ColorMatrix [source]
-
>>> tools.print_matrix(binary()) 127.0 127.0 127.0 0.0 0.0 127.0 127.0 127.0 0.0 0.0 127.0 127.0 127.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 -180.0 -180.0 -180.0 0.0 1.0
- Parameters
value – Power of effect applied, normally uses -1, 0, 1, on low values (like 0.001) act like
get_transition()
value- Returns
Color binary effect matrix
- blindness_deuteranopia(value=1.0) types.ColorMatrix [source]
- Simulates color blindness: Deuteranomaly (green-weak)Uses
get_transition()
- Parameters
value – Power of effect applied
- Returns
Color effect matrix adjusted for deuteranopia
- blindness_protanopia(value=1.0) types.ColorMatrix [source]
- Simulates color blindness: Protanomaly (red-weak)Uses
get_transition()
- Parameters
value – Power of effect applied
- Returns
Color effect matrix adjusted for protanopia
- blindness_tritanopia(value=1.0) types.ColorMatrix [source]
- Simulates color blindness: Tritanomaly (blue-yellow weak)Uses
get_transition()
- Parameters
value – Power of effect applied
- Returns
Color effect matrix adjusted for tritanopia