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

Name Type
red UnityEngine.Vector4
green UnityEngine.Vector4
blue UnityEngine.Vector4
alpha UnityEngine.Vector4
offset UnityEngine.Vector4
strength System.Single
clampOutput System.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

Name Type
preset TextStudio.TextStudio2DColorAdjustmentPreset
strength System.Single

Returns

TextStudio.TextStudio2DColorAdjustmentSpec

public TextStudio2DColorAdjustmentSpec WithStrength(float strength)

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

Parameters

Name Type
strength System.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

Name Type
saturation System.Single
hueDegrees System.Single
exposure System.Single
brightness System.Single
contrast System.Single
tint System.Nullable{UnityEngine.Color}
grayscale System.Single
sepia System.Single
invert System.Single
contrastPivot System.Single
strength System.Single
clampOutput System.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

Name Type
selection TextStudio.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

Name Type
straight UnityEngine.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

Name Type
straight UnityEngine.Color
coverage System.Single
opacity System.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