SColor

Index

Functions Index

Function

Properties Index

Property

Functions

ToHex

string ToHex ()

Return the Hex value of the color.

colorRedHex = Color.Red.ToHex()

Lerp

SColor Lerp (SColor b, float t)

Linearly interpolates between current color and b by t.

Parameter
Type
Description

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)

Equals

bool Equals (SColor other)

Returns true if colors are same.

Parameter
Type
Description

isItTrue = Color.Red.Equals(Color.Blue)

ToString

string ToString ()

Returns the RGBA value of the current color.

redString = Color.Red.ToString()

New

static SColor New (float r, float g, float b, float a)

Create a color by red, green, blue and alpha parameters.

Parameter
Type
Description

theColor = Color.New(255.0, 0.0, 0.0, 1.0)

FromHex

static SColor FromHex (string hex)

Create a color by Hex value.

Parameter
Type
Description

fromHex = Color.FromHex('FF0000')

Properties

R

float R get

Property Description

r = Color.Red.R

G

float G get

Property Description

g = Color.Red.G

B

float B get

Property Description

g = Color.Red.B

A

float A get

Property Description

g = Color.Red.A

Black

SColor Black get

Solid black. RGBA is (0, 0, 0, 1).

blackColor = Color.Black

White

SColor White get

Solid White. RGBA is (1, 1, 1, 1).

whiteColor = Color.White

Red

SColor Red get

Solid Red. RGBA is (1, 0, 0, 1).

blackRed = Color.Red

Blue

SColor Blue get

Solid Blue. RGBA is (0, 0, 1, 1).

blueColor = Color.Blue

Green

SColor Green get

Solid Green. RGBA is (0, 1, 0, 1).

greenColor = Color.Green

Yellow

SColor Yellow get

Yellow. RGBA is (1, 0.92, 0.016, 1).

yellowColor = Color.Yellow

Last updated

Sinespace® is a registered trademark of Sine Wave Entertainment Ltd, All Rights Reserved.