Class: LightSphereController

LightSphereController

LightSphereController creates an interactive sphere UI for light direction control. Features:

  • Circular interface with gradient background
  • Pointer-based interaction for light direction
  • Configurable size, position, and colors
  • Minimum theta angle constraint
  • Visual feedback with gradient and marker

new LightSphereController(parent [, options])

Creates a new LightSphereController instance.

Parameters:
Name Type Argument Description
parent HTMLElement | string

Parent element or selector where the controller will be mounted

options Object <optional>

Configuration options

Properties
Name Type Argument Default Description
width number <optional>
128

Width of the controller in pixels

height number <optional>
128

Height of the controller in pixels

top number <optional>
60

Top position offset in pixels

right number <optional>
0

Right position offset in pixels

thetaMin number <optional>
0

Minimum theta angle in degrees (constrains interaction radius)

colorSpot string <optional>
'#ffffff'

Color of the central spot in the gradient

colorBkg string <optional>
'#0000ff'

Color of the outer edge of the gradient

colorMark string <optional>
'#ff0000'

Color of the position marker

Source:

Methods


addLayer(layer)

Adds a layer to be controlled by this light sphere. The layer must support light control operations.

Parameters:
Name Type Description
layer Layer

Layer to be controlled

Source:

hide()

Hides the controller.

Source:
Returns:

The visibility style value

Type
string

show()

Makes the controller visible.

Source:
Returns:

The visibility style value

Type
string