LogoLogo
Scripting DocsSupport
Scripting
Scripting
  • Sinespace Scripting Documentation
  • Client Scripting
    • Viewer
      • SDialogues
      • SInput
      • SShared
      • SUI
    • Network
      • SChat
      • SNetwork
      • SPhotos
      • SVideos
      • SWebService
    • Player
      • SEconomy
      • SGroup
      • SInventory
      • SProfile
      • SQuests
    • Region
      • SCameraManager
      • SGrid
      • SHost
      • SPersistence
      • SPhysics
      • SPostFX
      • SScene
      • SScript
      • SRenderSettings
    • Components
      • SAnimation
      • SAnimator
      • SAudioReactiveAnimation
      • SAudioReactiveBase
      • SAudioReactiveLight
      • SAudioReactiveMaterial
      • SAudioReactiveParticleSystem
      • SAudioReactiveTransform
      • SAudioSource
      • SBoxCollider
      • SBrowserSurface
      • SCamera
      • SCanvasGroup
      • SCapsuleCollider
      • SCharacterController
      • SClickable
      • SCloth
      • SCollider
      • SContentSizeFitter
      • SEmbeddedVideo
      • SEventCalendar
      • SFurniture
      • SGraphicRaycaster
      • SHingeJoint
      • SLight
      • SLineRenderer
      • SMeshRenderer
      • SModularVehicle
      • SNavMeshAgent
      • SNavMeshObstacle
      • SNetworking
      • SParticleSystem
      • SPlayableDirector
      • SPostProcessVolume
      • SRectTransform
      • SReflectionProbe
      • SRenderer
      • SRigidbody
      • SRoomFloor
      • SSceneBackgroundMusic
      • SScriptingData
      • SScriptingEvents
      • SScriptingResources
      • SScriptingRuntime
      • SSeat
      • SSkinnedMeshRenderer
      • SSphereCollider
      • SStateMachine
      • STerrain
      • STrailRenderer
      • SUIButton
      • SUICanvas
      • SUIDropdown
      • SUIImage
      • SUIInputField
      • SUILayout
      • SUIRawImage
      • SUIScrollbar
      • SUISlider
      • SUIText
      • SUIToggle
      • SUIToolTipHint
      • SVirtualCamera
      • SVoiceZone
    • Types
      • SAnimationState
      • SAnimatorStateInfo
      • SAvatar
      • SAvatarAppearance
      • SChatMessage
      • SColor
      • SCommandBuffer
      • SDateTime
      • SGameObject
      • SGenre
      • SGroupInfo
      • SInventoryItem
      • SJointLimits
      • SJointMotor
      • SJointSpring
      • SLandmark
      • SLayerMask
      • SMaterial
      • SMath
      • SMusicDirectory
      • SMusicStation
      • SMusicStationList
      • SNetworkMessageLua
      • SOutfit
      • SParticle
      • SPhysicsHit
      • SPublicRegion
      • SQuaternion
      • SRay
      • SRect
      • SResource
      • SScore
      • SScoreRank
      • SString
      • SSubRegion
      • STrackInfo
      • STuneIn
      • SUIRaycastResult
      • SUserRegions
      • SVector
      • SUserProfile
      • SSocialMedia
      • SWebResponse
  • Server Scripting
    • Library
      • SMath
    • Network
      • SShared
      • SWebservice
    • Region
      • SAvatar
      • SCell
      • SObject
      • SParcel
      • SParcelManager
      • SRegionScript
      • SScene
    • Storage
      • SDatabase
  • Guides
    • Persistence
    • Server Scripts
  • Sample Projects
    • Smart Lights
    • Trivia Box
  • Changelog
    • API Changelog
  • Support
    • Report An Issue
Powered by GitBook

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

On this page
  • Index
  • Functions Index
  • Properties Index
  • Functions
  • ToHex
  • Lerp
  • Equals
  • ToString
  • New
  • FromHex
  • Properties
  • R
  • G
  • B
  • A
  • Black
  • White
  • Red
  • Blue
  • Green
  • Yellow

Was this helpful?

Export as PDF
  1. Client Scripting
  2. Types

SColor

Index

Functions Index

Function

Properties Index

Property

Functions

ToHex

string ToHex ()

Return the Hex value of the color.

colorRedHex = Color.Red.ToHex()

Lerp

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

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

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

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

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

blackColor = Color.Black

White

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

whiteColor = Color.White

Red

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

blackRed = Color.Red

Blue

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

blueColor = Color.Blue

Green

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

greenColor = Color.Green

Yellow

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

yellowColor = Color.Yellow
PreviousSChatMessageNextSCommandBuffer

Last updated 2 years ago

Was this helpful?

string ()

SColor (SColor b, float t)

bool (SColor other)

override string ()

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

static SColor (string hex)

float get

float get

float get

float get

SColor get

SColor get

SColor get

SColor get

SColor get

SColor get

Lerp ( b, float t)

bool Equals ( other)

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

static FromHex (string hex)

Black get

White get

Red get

Blue get

Green get

Yellow get

SColor
SColor
SColor
SColor
SColor
SColor
SColor
SColor
SColor
SColor
SColor
ToHex
Lerp
Equals
ToString
New
FromHex
R
G
B
A
Black
White
Red
Blue
Green
Yellow