Vixen
02b45cc4
csharp
public readonly struct Color3

A linear colour with no alpha: light colours, emissive intensities, tint parameters — the places where an alpha channel would be twelve wasted bytes per instance and one more thing to leave uninitialised.

No guide page documents this yet — the page shows what the code says about itself.

Fields and properties (7)

  • public const int ComponentCount

    Number of components.

  • public readonly float R

    The red component.

  • public readonly float G

    The green component.

  • public readonly float B

    The blue component.

  • public static Color3 Black

    Black.

  • public static Color3 White

    White.

  • public float this[int index]

    The component at .

Methods (24)

  • public Color3(float r, float g, float b)

    Builds a colour from its components.

  • public Color3(float intensity)

    A grey with the given intensity.

  • public ReadOnlySpan<float> AsSpan()

    The components as a span. Valid as long as the colour it came from.

  • public float Luminance()

    The relative luminance.

  • public static Color3 FromSrgb(Color3 srgb)

    Decodes an sRGB-encoded colour into linear space.

  • public Color3 ToSrgb()

    Encodes this linear colour as sRGB.

  • public static Color3 Lerp(Color3 from, Color3 to, float amount)

    Interpolates between two colours.

  • public static bool NearEqual(Color3 left, Color3 right, float tolerance = 1E-06)

    Whether two colours agree to within a tolerance.

  • public static Color3 operator +(Color3 left, Color3 right)

    Adds two colours.

  • public static Color3 operator -(Color3 left, Color3 right)

    Subtracts one colour from another.

  • public static Color3 operator *(Color3 left, Color3 right)

    Multiplies component by component.

  • public static Color3 operator *(Color3 color, float scale)

    Scales a colour.

  • public static Color3 operator *(float scale, Color3 color)

    Scales a colour.

  • public static bool operator ==(Color3 left, Color3 right)

    Exact component-wise equality, IEEE semantics. See NearEqual.

  • public static bool operator !=(Color3 left, Color3 right)

    The negation of op_Equality.

  • public static explicit operator Vector3(Color3 color)

    Reinterprets the colour as a vector.

  • public static explicit operator Color3(Vector3 vector)

    Reinterprets a vector as a colour.

  • public void Deconstruct(out float r, out float g, out float b)

    Splits the colour into its components.

  • public bool Equals(Color3 other)

    Indicates whether the current object is equal to another object of the same type.

  • public override bool Equals(object? obj)

    Indicates whether this instance and a specified object are equal.

  • public override int GetHashCode()

    Returns the hash code for this instance.

  • public override string ToString()

    Returns the fully qualified type name of this instance.

  • public string ToString(string? format, IFormatProvider? formatProvider)

    Formats the value of the current instance using the specified format.

  • public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider? provider = null)

    Tries to format the value of the current instance into the provided span of characters.

Used by (39)

  • ArenaThirdPersonShooter
  • ArenaFrameThirdPersonShooter
  • ArenaIlluminationThirdPersonShooter
  • ClusteredLightingTestsVixen.Rendering.Tests
  • Color4Vixen.Core.Mathematics
  • ColorTestsVixen.Core.Mathematics.Tests
  • ForwardLightingRenderFeatureVixen.Rendering
  • ForwardLightingTestsVixen.Rendering.Tests
  • LightVixen.Rendering
  • LightExtractionSystemVixen.Rendering
  • LightExtractionTestsVixen.Rendering.Tests
  • LightsVixen.Rendering
  • MaterialSurfaceVixen.Rendering
  • MaterialSurfaceTestsVixen.Rendering.Tests
  • MathScalarsVixen.Core.Yaml
  • MeshInstanceVixen.Rendering
  • ParticleLightTestsVixen.Rendering.Tests
  • PhotometryVixen.Rendering
  • PhotometryTestsVixen.Rendering.Tests
  • PhysicalSkyVixen.Rendering
  • PhysicalSkyTestsVixen.Rendering.Tests
  • PostEffectTestsVixen.Rendering.PostFx.Tests
  • PunctualShadowTestsVixen.Rendering.Tests
  • RenderLightVixen.Rendering
  • RenderPassAssetVixen.Rendering
  • TonemapRendererVixen.Rendering.PostFx
  • TypeRegistrationVixen.Core.Mathematics
  • Vixen_Core_Mathematics_Color3SerializerVixen.Core.Mathematics
  • Vixen_Rendering_Compositor_RenderPassAssetSerializerVixen.Rendering
  • Vixen_Rendering_Ecs_LightSerializerVixen.Rendering
  • WhiteBalanceTestsVixen.Rendering.Tests
  • Color3DrawerVixen.Editor.Inspector
  • DrawerRegistryVixen.Editor.Inspector
  • LightTestsVixen.Editor.SceneView.Tests
  • SceneFormatMigrationTestsVixen.Editor.SceneView.Tests
  • SceneLightDataVixen.Editor.Core
  • SceneLinesVixen.Editor.SceneView
  • SceneRenderComponentTestsVixen.Editor.Assets.Tests
  • SurfacesVixen.Editor.SceneView.Tests