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
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
ColorFThe value to convert.
Returns
Equals(ColorF)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(ColorF other)
Parameters
other
ColorFAn object to compare with this object.
Returns
Equals(Vector4D)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(Vector4D other)
Parameters
other
Vector4DAn object to compare with this object.
Returns
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
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)
public static explicit operator string(ColorF c)
Parameters
c
ColorFObject to be converted.
Returns
explicit operator ColorF(string)
public static explicit operator ColorF(string stg)
Parameters
stg
stringObject to be converted.
Returns
implicit operator ColorF(Color32)
public static implicit operator ColorF(Color32 c)
Parameters
c
Color32Object to be converted.
Returns
implicit operator ColorF(Vector4D)
public static implicit operator ColorF(Vector4D c)
Parameters
c
Vector4DObject to be converted.
Returns
implicit operator ColorF(Color)
Implicit conversion operator.(Godot.Color to ColorF)
public static implicit operator ColorF(Color c)
Parameters
c
ColorObject to be converted.