1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-12 08:48:30 +00:00
4
Color Corrections
DarthAffe edited this page 2017-01-08 15:36:50 +01:00

Color-Corrections are meant to modify a color in a fixed, predefined way.

A good example and the only predefined Color-Correction in CUE.NET is the gamma correction (often configurable in games).

Applying a color-correction to a brush is straight forward and might look like this:

IColorCorrection gammaCorrection = new GammaCorrection(2);
myBrush.ColorCorrections.Add(gammaCorrection);

Implementing an own color-correction

To implement your own color-correction you just need to implement the IColorCorrection-interface which contains only the ApplyTo-method.

    public interface IColorCorrection
    {
        void ApplyTo(CorsairColor color);
    }

The ApplyTo-method contains all the logic to modify the color given as a parameter.
You can look at the gamma-correction for a reference on how this might look.