Skip to content
Eduard Gushchin edited this page Jul 1, 2026 · 5 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.Color
Namespace Electron2D
Kind struct
Category Math and Data

Overview

Represents the color value type.

Syntax

public struct Electron2D.Color : System.IEquatable<Electron2D.Color>

Godot 4.7 C# profile compatibility

Profile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: Color

RGBA value type baseline with arithmetic, interpolation, clamp and HTML conversion.

Remarks

This type is part of the Electron2D 0.1.0 Preview public API.

Thread Safety

Instances of this type are not synchronized. Access them from the thread that owns the object unless the member documentation states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

Members

Member Kind Summary
Black Field Represents the black value.
Transparent Field Represents the transparent value.
White Field Represents the white value.
A Property Gets or sets the a value.
B Property Gets or sets the b value.
G Property Gets or sets the g value.
R Property Gets or sets the r value.
Electron2D.Color(System.Single, System.Single, System.Single, System.Single) Constructor Initializes a new instance of the Color type.
Clamp(Electron2D.Color, Electron2D.Color) Method Executes the clamp operation.
Darkened(System.Single) Method Executes the darkened operation.
Equals(Electron2D.Color) Method Executes the equals operation.
Equals(System.Object) Method Executes the equals operation.
FromHtml(System.String) Method Executes the from html operation.
GetHashCode() Method Gets the hash code value.
IsEqualApprox(Electron2D.Color) Method Checks whether equal approx is true.
Lerp(Electron2D.Color, System.Single) Method Executes the lerp operation.
Lightened(System.Single) Method Executes the lightened operation.
ToHtml(System.Boolean) Method Executes the to html operation.
ToString() Method Executes the to string operation.
op_Addition(Electron2D.Color, Electron2D.Color) Method Applies the + operator.
op_Division(Electron2D.Color, System.Single) Method Applies the / operator.
op_Equality(Electron2D.Color, Electron2D.Color) Method Applies the == operator.
op_Inequality(Electron2D.Color, Electron2D.Color) Method Applies the != operator.
op_Multiply(Electron2D.Color, Electron2D.Color) Method Applies the * operator.
op_Multiply(Electron2D.Color, System.Single) Method Applies the * operator.
op_Multiply(System.Single, Electron2D.Color) Method Applies the * operator.
op_Subtraction(Electron2D.Color, Electron2D.Color) Method Applies the - operator.

Member Details

Black

Kind: Field

public static Electron2D.Color Black

Summary

Represents the black value.

Remarks

Use this field as a stable value supplied by the declaring type.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

Transparent

Kind: Field

public static Electron2D.Color Transparent

Summary

Represents the transparent value.

Remarks

Use this field as a stable value supplied by the declaring type.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

White

Kind: Field

public static Electron2D.Color White

Summary

Represents the white value.

Remarks

Use this field as a stable value supplied by the declaring type.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

A

Kind: Property

public System.Single A { get; set; }

Summary

Gets or sets the a value.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current a value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

B

Kind: Property

public System.Single B { get; set; }

Summary

Gets or sets the b value.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current b value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

G

Kind: Property

public System.Single G { get; set; }

Summary

Gets or sets the g value.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current g value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

R

Kind: Property

public System.Single R { get; set; }

Summary

Gets or sets the r value.

Remarks

This property follows the validation and lifetime rules of its declaring type.

Value

The current r value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

Electron2D.Color(System.Single, System.Single, System.Single, System.Single)

Kind: Constructor

public Electron2D.Color(System.Single r, System.Single g, System.Single b, System.Single a)

Summary

Initializes a new instance of the Color type.

Remarks

The new instance follows the lifetime and validation rules of its declaring type.

Parameters

  • r: The r value.
  • g: The g value.
  • b: The b value.
  • a: The a value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

Clamp(Electron2D.Color, Electron2D.Color)

Kind: Method

public Electron2D.Color Clamp(Electron2D.Color, Electron2D.Color)(Electron2D.Color min, Electron2D.Color max)

Summary

Executes the clamp operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • min: The min value.
  • max: The max value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

Darkened(System.Single)

Kind: Method

public Electron2D.Color Darkened(System.Single)(System.Single amount)

Summary

Executes the darkened operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • amount: The amount value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

Equals(Electron2D.Color)

Kind: Method

public System.Boolean Equals(Electron2D.Color)(Electron2D.Color other)

Summary

Executes the equals operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • other: The other value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

Equals(System.Object)

Kind: Method

public System.Boolean Equals(System.Object)(System.Object obj)

Summary

Executes the equals operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • obj: The obj value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

FromHtml(System.String)

Kind: Method

public static Electron2D.Color FromHtml(System.String)(System.String html)

Summary

Executes the from html operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • html: The html value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

GetHashCode()

Kind: Method

public System.Int32 GetHashCode()()

Summary

Gets the hash code value.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

The current hash code value.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

IsEqualApprox(Electron2D.Color)

Kind: Method

public System.Boolean IsEqualApprox(Electron2D.Color)(Electron2D.Color color)

Summary

Checks whether equal approx is true.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • color: The color value.

Returns

true when the condition is met; otherwise, false.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

Lerp(Electron2D.Color, System.Single)

Kind: Method

public Electron2D.Color Lerp(Electron2D.Color, System.Single)(Electron2D.Color to, System.Single weight)

Summary

Executes the lerp operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • to: The to value.
  • weight: The weight value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

Lightened(System.Single)

Kind: Method

public Electron2D.Color Lightened(System.Single)(System.Single amount)

Summary

Executes the lightened operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • amount: The amount value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

ToHtml(System.Boolean)

Kind: Method

public System.String ToHtml(System.Boolean)(System.Boolean includeAlpha)

Summary

Executes the to html operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Parameters

  • includeAlpha: The include alpha value.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

ToString()

Kind: Method

public System.String ToString()()

Summary

Executes the to string operation.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

The result of the operation.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

op_Addition(Electron2D.Color, Electron2D.Color)

Kind: Method

public static Electron2D.Color op_Addition(Electron2D.Color, Electron2D.Color)(Electron2D.Color left, Electron2D.Color right)

Summary

Applies the + operator.

Remarks

This operator returns a value derived from the supplied operands.

Parameters

  • left: The left value.
  • right: The right value.

Returns

The result of the operator.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

op_Division(Electron2D.Color, System.Single)

Kind: Method

public static Electron2D.Color op_Division(Electron2D.Color, System.Single)(Electron2D.Color color, System.Single scalar)

Summary

Applies the / operator.

Remarks

This operator returns a value derived from the supplied operands.

Parameters

  • color: The color value.
  • scalar: The scalar value.

Returns

The result of the operator.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

op_Equality(Electron2D.Color, Electron2D.Color)

Kind: Method

public static System.Boolean op_Equality(Electron2D.Color, Electron2D.Color)(Electron2D.Color left, Electron2D.Color right)

Summary

Applies the == operator.

Remarks

This operator returns a value derived from the supplied operands.

Parameters

  • left: The left value.
  • right: The right value.

Returns

The result of the operator.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

op_Inequality(Electron2D.Color, Electron2D.Color)

Kind: Method

public static System.Boolean op_Inequality(Electron2D.Color, Electron2D.Color)(Electron2D.Color left, Electron2D.Color right)

Summary

Applies the != operator.

Remarks

This operator returns a value derived from the supplied operands.

Parameters

  • left: The left value.
  • right: The right value.

Returns

The result of the operator.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

op_Multiply(Electron2D.Color, Electron2D.Color)

Kind: Method

public static Electron2D.Color op_Multiply(Electron2D.Color, Electron2D.Color)(Electron2D.Color left, Electron2D.Color right)

Summary

Applies the * operator.

Remarks

This operator returns a value derived from the supplied operands.

Parameters

  • left: The left value.
  • right: The right value.

Returns

The result of the operator.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

op_Multiply(Electron2D.Color, System.Single)

Kind: Method

public static Electron2D.Color op_Multiply(Electron2D.Color, System.Single)(Electron2D.Color color, System.Single scalar)

Summary

Applies the * operator.

Remarks

This operator returns a value derived from the supplied operands.

Parameters

  • color: The color value.
  • scalar: The scalar value.

Returns

The result of the operator.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

op_Multiply(System.Single, Electron2D.Color)

Kind: Method

public static Electron2D.Color op_Multiply(System.Single, Electron2D.Color)(System.Single scalar, Electron2D.Color color)

Summary

Applies the * operator.

Remarks

This operator returns a value derived from the supplied operands.

Parameters

  • scalar: The scalar value.
  • color: The color value.

Returns

The result of the operator.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

op_Subtraction(Electron2D.Color, Electron2D.Color)

Kind: Method

public static Electron2D.Color op_Subtraction(Electron2D.Color, Electron2D.Color)(Electron2D.Color left, Electron2D.Color right)

Summary

Applies the - operator.

Remarks

This operator returns a value derived from the supplied operands.

Parameters

  • left: The left value.
  • right: The right value.

Returns

The result of the operator.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Color

Clone this wiki locally