Table of Contents

Struct ColorF

Namespace
Cobilas.GodotEngine.Utility
Assembly
com.cobilas.godot.utility.dll

Represents a normalized ARGB value between (0 and 1).

[Serializable]
public struct ColorF : IEquatable<ColorF>, IEquatable<Vector4D>
Implements
Inherited Members

Constructors

ColorF(Color32)

Creates a new instance of this object.

public ColorF(Color32 color)

Parameters

color Color32

ColorF(Vector4D)

Creates a new instance of this object.

public ColorF(Vector4D color)

Parameters

color Vector4D

ColorF(Color)

Creates a new instance of this object.

public ColorF(Color color)

Parameters

color Color

ColorF(float, float, float, float)

Creates a new instance of this object.

public ColorF(float r, float g, float b, float a)

Parameters

r float
g float
b float
a float

Properties

A

Represents the alpha value.

public float A { readonly get; set; }

Property Value

float

Allows you to set the alpha value.

B

Represents the value blue.

public float B { readonly get; set; }

Property Value

float

Allows you to set the value blue.

G

Represents the value green.

public float G { readonly get; set; }

Property Value

float

Allows you to set the value green.

R

Represents the value red.

public float R { readonly get; set; }

Property Value

float

Allows you to set the value red.

Methods

ColorFToHSV(ColorF)

Converts a ColorF value to HSV.

public static Vector4D ColorFToHSV(ColorF c)

Parameters

c ColorF

The value to convert.

Returns

Vector4D

Returns a Vector4D value with HSV values.(x:h / y:s / z:v)

Equals(ColorF)

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

public readonly bool Equals(ColorF other)

Parameters

other ColorF

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(Vector4D)

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

public readonly bool Equals(Vector4D other)

Parameters

other Vector4D

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

HSVToColorF(float, float, float, float)

Constructs a color from an HSV profile, with values on the range of 0 to 1. This is equivalent to using each of the h/s/v properties, but much more efficient.

public static ColorF HSVToColorF(float h, float s, float v, float a = 1)

Parameters

h float

Hue value.

s float

Saturation value.

v float

Value.

a float

Alpha value.

Returns

ColorF

The constructed color.

ToString()

Returns the fully qualified type name of this instance.

public override readonly string ToString()

Returns

string

The fully qualified type name.

Operators

explicit operator string(ColorF)

Explicit conversion operator.(ColorF to string)

public static explicit operator string(ColorF c)

Parameters

c ColorF

Object to be converted.

Returns

string

explicit operator ColorF(string)

Explicit conversion operator.(string to ColorF)

public static explicit operator ColorF(string stg)

Parameters

stg string

Object to be converted.

Returns

ColorF

implicit operator ColorF(Color32)

Implicit conversion operator.(Color32 to ColorF)

public static implicit operator ColorF(Color32 c)

Parameters

c Color32

Object to be converted.

Returns

ColorF

implicit operator ColorF(Vector4D)

Implicit conversion operator.(Vector4D to ColorF)

public static implicit operator ColorF(Vector4D c)

Parameters

c Vector4D

Object to be converted.

Returns

ColorF

implicit operator ColorF(Color)

Implicit conversion operator.(Godot.Color to ColorF)

public static implicit operator ColorF(Color c)

Parameters

c Color

Object to be converted.

Returns

ColorF