Skip to content

TextStudio2DColorAdjustmentSpec

StructTextStudioTextStudio
public struct TextStudio2DColorAdjustmentSpec

A linear-light straight RGBA transform, separate from geometric coverage.

TextStudio2DColorAdjustmentSpec(Vector4, Vector4, Vector4, Vector4, Vector4, float, bool)

Section titled “TextStudio2DColorAdjustmentSpec(Vector4, Vector4, Vector4, Vector4, Vector4, float, bool)”
public TextStudio2DColorAdjustmentSpec(Vector4 red, Vector4 green, Vector4 blue, Vector4 alpha, Vector4 offset = null, float strength = 1, bool clampOutput = false)

Creates a straight RGBA matrix transform with the supplied channel rows, offset, strength, and output clamping behavior.

Parameters

NameType
redUnityEngine.Vector4
greenUnityEngine.Vector4
blueUnityEngine.Vector4
alphaUnityEngine.Vector4
offsetUnityEngine.Vector4
strengthSystem.Single
clampOutputSystem.Boolean

Preset(TextStudio2DColorAdjustmentPreset, float)

Section titled “Preset(TextStudio2DColorAdjustmentPreset, float)”
public static TextStudio2DColorAdjustmentSpec Preset(TextStudio2DColorAdjustmentPreset preset, float strength = 1)

Creates the selected color-adjustment preset with the supplied strength.

Parameters

NameType
presetTextStudio.TextStudio2DColorAdjustmentPreset
strengthSystem.Single

Returns

TextStudio.TextStudio2DColorAdjustmentSpec

public TextStudio2DColorAdjustmentSpec WithStrength(float strength)

Returns a color-adjustment specification copy with the supplied transform strength.

Parameters

NameType
strengthSystem.Single

Returns

TextStudio.TextStudio2DColorAdjustmentSpec

Adjust(float, float, float, float, float, Color?, float, float, float, float, float, bool)

Section titled “Adjust(float, float, float, float, float, Color?, float, float, float, float, float, bool)”
public static TextStudio2DColorAdjustmentSpec Adjust(float saturation = 1, float hueDegrees = 0, float exposure = 0, float brightness = 0, float contrast = 1, Color? tint = null, float grayscale = 0, float sepia = 0, float invert = 0, float contrastPivot = 0.18, float strength = 1, bool clampOutput = false)

Named controls are evaluated in linear light. Contrast uses an explicit linear pivot.

Parameters

NameType
saturationSystem.Single
hueDegreesSystem.Single
exposureSystem.Single
brightnessSystem.Single
contrastSystem.Single
tintSystem.Nullable{UnityEngine.Color}
grayscaleSystem.Single
sepiaSystem.Single
invertSystem.Single
contrastPivotSystem.Single
strengthSystem.Single
clampOutputSystem.Boolean

Returns

TextStudio.TextStudio2DColorAdjustmentSpec

WithSurfaceSelection(TextStudio2DSurfaceSelection)

Section titled “WithSurfaceSelection(TextStudio2DSurfaceSelection)”
public TextStudio2DColorAdjustmentSpec WithSurfaceSelection(TextStudio2DSurfaceSelection selection)

Returns a color-adjustment specification copy targeting the supplied surface selection.

Parameters

NameType
selectionTextStudio.TextStudio2DSurfaceSelection

Returns

TextStudio.TextStudio2DColorAdjustmentSpec

public TextStudio2DColorAdjustmentSpec Resolve()

Resolves authored color adjustments into a matrix transform while preserving strength, clamping, and surface selection.

Returns

TextStudio.TextStudio2DColorAdjustmentSpec

public Color Apply(Color straight)

CPU reference for the GPU contract. Input and output colors use straight linear RGBA.

Parameters

NameType
straightUnityEngine.Color

Returns

UnityEngine.Color

public Color ApplyContribution(Color straight, float coverage, float opacity = 1)

Transforms straight RGBA and returns a premultiplied contribution weighted by coverage and opacity.

Parameters

NameType
straightUnityEngine.Color
coverageSystem.Single
opacitySystem.Single

Returns

UnityEngine.Color

public Vector4 Red { get; }

Returns

UnityEngine.Vector4

public Vector4 Green { get; }

Returns

UnityEngine.Vector4

public Vector4 Blue { get; }

Returns

UnityEngine.Vector4

public Vector4 Alpha { get; }

Returns

UnityEngine.Vector4

public Vector4 Offset { get; }

Returns

UnityEngine.Vector4

public float Strength { get; }

Returns

System.Single

public bool ClampOutput { get; }

Returns

System.Boolean

public static TextStudio2DColorAdjustmentSpec Identity { get; }

Returns

TextStudio.TextStudio2DColorAdjustmentSpec

public TextStudio2DColorAdjustmentMode Mode { get; }

Returns

TextStudio.TextStudio2DColorAdjustmentMode

public TextStudio2DSurfaceSelection SurfaceSelection { get; }

Returns

TextStudio.TextStudio2DSurfaceSelection

public bool IsNeutral { get; }

Returns

System.Boolean