|
Sinespace Client
2023.2.17543
Client-side scripting for Sinespace
|
|
| SColor (float r, float g, float b, float a) |
| Creates a color from red, green, blue and alpha parameters. More...
|
|
string | ToHex () |
| Returns the Hex value of the color. More...
|
|
| SColor (float r, float g, float b) |
| Creates a color from red, green, and blue parameters. Alpha is assumed to be fully opaque. More...
|
|
SColor | Lerp (SColor b, float t) |
| Linearly interpolates between current color and b by t. More...
|
|
bool | Equals (SColor other) |
| Returns true if the colors are same. More...
|
|
override string | ToString () |
| Returns a string RGBA value of current color More...
|
|
|
static SColor | New (float r, float g, float b, float a) |
| Creates a color from red, green, blue and alpha parameters. More...
|
|
static SColor | FromHex (string hex) |
| Creates a color from Hex value More...
|
|
|
float | R |
|
float | G |
|
float | B |
|
float | A |
|
|
SColor | Black [get] |
| Solid black. RGBA is (0, 0, 0, 1). More...
|
|
SColor | White [get] |
| Solid White. RGBA is (1, 1, 1, 1). More...
|
|
SColor | Red [get] |
| Solid Red. RGBA is (1, 0, 0, 1). More...
|
|
SColor | Blue [get] |
| Solid Blue. RGBA is (0, 0, 1, 1). More...
|
|
SColor | Green [get] |
| Solid Green. RGBA is (0, 1, 0, 1). More...
|
|
SColor | Yellow [get] |
| Yellow. RGBA is (1, 0.92, 0.016, 1), but the color is nice to look at! More...
|
|
◆ SColor() [1/2]
SineSpace.Scripting.Types.SColor.SColor |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
a |
|
) |
| |
Creates a color from red, green, blue and alpha parameters.
- Parameters
-
◆ SColor() [2/2]
SineSpace.Scripting.Types.SColor.SColor |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b |
|
) |
| |
Creates a color from red, green, and blue parameters. Alpha is assumed to be fully opaque.
- Parameters
-
◆ Equals()
bool SineSpace.Scripting.Types.SColor.Equals |
( |
SColor |
other | ) |
|
Returns true if the colors are same.
- Parameters
-
other | Another color you want to compare |
local colorR=Color.New(1,0,0,1)
Space.Log(colorR.Equals(Color.Red))
–Print "true"
◆ FromHex()
static SColor SineSpace.Scripting.Types.SColor.FromHex |
( |
string |
hex | ) |
|
|
static |
Creates a color from Hex value
- Parameters
-
–Create a cube and set a new material to it
–Add ScriptingRuntime on it
local mat=Space.Host.ExecutingObject.Renderer.Material
mat.SetColor("_Color",Color.FromHex("FF0000"))
–The cube will turn to red
◆ Lerp()
SColor SineSpace.Scripting.Types.SColor.Lerp |
( |
SColor |
b, |
|
|
float |
t |
|
) |
| |
Linearly interpolates between current color and b by t.
- Parameters
-
b | Color b. |
t | Float for combining a and b. |
–Create a cube and set a new material to it
–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)
◆ New()
static SColor SineSpace.Scripting.Types.SColor.New |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
a |
|
) |
| |
|
static |
Creates a color from red, green, blue and alpha parameters.
- Parameters
-
–Create a cube and set a new material to it
–Add ScriptingRuntime on it
local mat=Space.Host.ExecutingObject.Renderer.Material
mat.SetColor("_Color",Color.New(0,0,1,1))
–The cube will turn to blue
◆ ToHex()
string SineSpace.Scripting.Types.SColor.ToHex |
( |
| ) |
|
Returns the Hex value of the color.
Space.Log(Color.Red.ToHex())
–Print "FF0000"
◆ ToString()
override string SineSpace.Scripting.Types.SColor.ToString |
( |
| ) |
|
Returns a string RGBA value of current color
Space.Log(Color.Red.ToString())
–Print "[1,0,0,1]"
float SineSpace.Scripting.Types.SColor.A |
float SineSpace.Scripting.Types.SColor.B |
float SineSpace.Scripting.Types.SColor.G |
float SineSpace.Scripting.Types.SColor.R |
◆ Black
SColor SineSpace.Scripting.Types.SColor.Black |
|
get |
Solid black. RGBA is (0, 0, 0, 1).
–Create a cube and set a new material to it
–Add ScriptingRuntime on it
local mat=Space.Host.ExecutingObject.Renderer.Material
mat.SetColor("_Color",Color.Black)
–The cube will turn to black
◆ Blue
SColor SineSpace.Scripting.Types.SColor.Blue |
|
get |
Solid Blue. RGBA is (0, 0, 1, 1).
–Create a cube and set a new material to it
–Add ScriptingRuntime on it
local mat=Space.Host.ExecutingObject.Renderer.Material
mat.SetColor("_Color",Color.Blue)
–The cube will turn to
Blue
◆ Green
SColor SineSpace.Scripting.Types.SColor.Green |
|
get |
Solid Green. RGBA is (0, 1, 0, 1).
–Create a cube and set a new material to it
–Add ScriptingRuntime on it
local mat=Space.Host.ExecutingObject.Renderer.Material
mat.SetColor("_Color",Color.Green)
–The cube will turn to
Green
◆ Red
SColor SineSpace.Scripting.Types.SColor.Red |
|
get |
Solid Red. RGBA is (1, 0, 0, 1).
–Create a cube and set a new material to it
–Add ScriptingRuntime on it
local mat=Space.Host.ExecutingObject.Renderer.Material
mat.SetColor("_Color",Color.Red)
–The cube will turn to
Red
◆ White
SColor SineSpace.Scripting.Types.SColor.White |
|
get |
Solid White. RGBA is (1, 1, 1, 1).
–Create a cube and set a new material to it
–Add ScriptingRuntime on it
local mat=Space.Host.ExecutingObject.Renderer.Material
mat.SetColor("_Color",Color.White)
–The cube will turn to
White
◆ Yellow
SColor SineSpace.Scripting.Types.SColor.Yellow |
|
get |
Yellow. RGBA is (1, 0.92, 0.016, 1), but the color is nice to look at!
–Create a cube and set a new material to it
–Add ScriptingRuntime on it
local mat=Space.Host.ExecutingObject.Renderer.Material
mat.SetColor("_Color",Color.Yellow)
–The cube will turn to
Yellow
SColor White
Solid White. RGBA is (1, 1, 1, 1).
Definition: SColor.cs:196
SColor Lerp(SColor b, float t)
Linearly interpolates between current color and b by t.
Definition: SColor.cs:109
SColor Red
Solid Red. RGBA is (1, 0, 0, 1).
Definition: SColor.cs:213
SColor Green
Solid Green. RGBA is (0, 1, 0, 1).
Definition: SColor.cs:247
SColor Yellow
Yellow. RGBA is (1, 0.92, 0.016, 1), but the color is nice to look at!
Definition: SColor.cs:264
SColor Blue
Solid Blue. RGBA is (0, 0, 1, 1).
Definition: SColor.cs:230