string ToHex ()
Return the Hex value of the color.
Lerp ( b, float t)
Linearly interpolates between current color and b by t.
bool Equals ( other)
Returns true if colors are same.
string ToString ()
Returns the RGBA value of the current color.
static New (float r, float g, float b, float a)
Create a color by red, green, blue and alpha parameters.
static FromHex (string hex)
Create a color by Hex value.
float R get
Property Description
float G get
Property Description
float B get
Property Description
float A get
Property Description
Black get
Solid black. RGBA is (0, 0, 0, 1).
White get
Solid White. RGBA is (1, 1, 1, 1).
Red get
Solid Red. RGBA is (1, 0, 0, 1).
Blue get
Solid Blue. RGBA is (0, 0, 1, 1).
Green get
Solid Green. RGBA is (0, 1, 0, 1).
Yellow get
Yellow. RGBA is (1, 0.92, 0.016, 1).
string ToHex ()
SColor Lerp (SColor b, float t)
bool Equals (SColor other)
override string ToString ()
static SColor New (float r, float g, float b, float a)
static SColor FromHex (string hex)
float R get
float G get
float B get
float A get
SColor Black get
SColor White get
SColor Red get
SColor Blue get
SColor Green get
SColor get
colorRedHex = Color.Red.ToHex()lerpedRedBlue = Color.Blue.Lerp(Color.Red, 0.5)--create a cube and set a new material.
--add ScriptingRuntime.
local mat=Space.Host.ExecutingObject.Renderer.Material
function ChangeColor()
mat.SetColor("_Color",Color.Red.Lerp(Color.Blue,Space.Math.PingPong(Space.Time,1)))
end
Space.Host.ExecutingObject.OnUpdate(ChangeColor)isItTrue = Color.Red.Equals(Color.Blue)redString = Color.Red.ToString()theColor = Color.New(255.0, 0.0, 0.0, 1.0)fromHex = Color.FromHex('FF0000')r = Color.Red.Rg = Color.Red.Gg = Color.Red.Bg = Color.Red.AblackColor = Color.BlackwhiteColor = Color.WhiteblackRed = Color.RedblueColor = Color.BluegreenColor = Color.Green
yellowColor = Color.Yellow