Skip to main content

ColorFilter

Namespace:FairyGUI
Source:Assets/Scripts/Filter/ColorFilter.cs (line 10)

public class ColorFilter : IFilter

Interfaces:IFilter

Constructors​

ColorFilter()​

public ColorFilter();

Source:Filter/ColorFilter.cs (line 24)

Methods​

AdjustBrightness(float)​

public void AdjustBrightness(float value);

Changes the brightness. Typical values are in the range (-1, 1). Values above zero will make the image brighter, values below zero will make it darker.

ParameterTypeDescription
valuefloat

Source:Filter/ColorFilter.cs (line 120)

AdjustContrast(float)​

public void AdjustContrast(float value);

Changes the contrast. Typical values are in the range (-1, 1). Values above zero will raise, values below zero will reduce the contrast.

ParameterTypeDescription
valuefloat

Source:Filter/ColorFilter.cs (line 104)

AdjustHue(float)​

public void AdjustHue(float value);

Changes the hue of the image. Typical values are in the range (-1, 1).

ParameterTypeDescription
valuefloat

Source:Filter/ColorFilter.cs (line 132)

AdjustSaturation(float)​

public void AdjustSaturation(float sat);

Changes the saturation. Typical values are in the range (-1, 1). Values above zero will raise, values below zero will reduce the saturation. '-1' will produce a grayscale image.

ParameterTypeDescription
satfloat

Source:Filter/ColorFilter.cs (line 84)

ConcatValues(float[])​

public void ConcatValues(params float[] values);
ParameterTypeDescription
valuesfloat[]

Source:Filter/ColorFilter.cs (line 194)

Dispose()​

public void Dispose();

Source:Filter/ColorFilter.cs (line 50)

Invert()​

public void Invert();

Source:Filter/ColorFilter.cs (line 70)

Reset()​

public void Reset();

Changes the filter matrix back to the identity matrix

Source:Filter/ColorFilter.cs (line 167)

Tint(Color, float)​

public void Tint(Color color, float amount = 1.0f);

Tints the image in a certain color, analog to what can be done in Adobe Animate.

ParameterTypeDescription
colorColorthe RGB color with which the image should be tinted.
amountfloatthe intensity with which tinting should be applied. Range (0, 1).

Source:Filter/ColorFilter.cs (line 150)

Update()​

public void Update();

Source:Filter/ColorFilter.cs (line 66)

Properties​

target​

public DisplayObject target { get; set; }

Source:Filter/ColorFilter.cs (line 30)