Skip to content

Latest commit

 

History

History
60 lines (41 loc) · 1.92 KB

ActivityColorManager.md

File metadata and controls

60 lines (41 loc) · 1.92 KB

ActivityColorManager

The ActivityColorManager maintains a consistent mapping between activity participants and colors. Colors are assigned as user join the activity and are released when participants leave.

Namespace

ConvergenceJointUtils.ActivityColorManager

#Example

const activity = <some Convergence Activity>;

const colorManager = new ConvergenceJointUtils.ActivityColorManager(activity);
const color = colorManager.color("someSessionId");

#API

Method Description
constructor(activity, colors?) Creates a new ActivityColorManager.
dispose() Disconnects the ActivityColorManager from the paper and model.
isDisposed() Determines if the ActivityColorManager is disposed.

Constructor

ActivityColorManager(activity, colors?) Constructs a new ActivityColorManager bound to the supplied activity. Colors are assigned and released as participants join and leave the activity. An optional array of colors can be passed in, which will determine the pallet of colors assigned to users. If the colors parameter is omitted, a default pallet will be used.

const activity = <some Convergence Activity>;

const colorManager = new ConvergenceJointUtils.ActivityColorManager(activity);

Prototype Methods

dispose()

Disconnects the ActivityColorManager from the activity.

const = activityColorManager = // new ActivityColorManager manager;
console.log(activityColorManager.isDisposed()); // prints: false

activityColorManager.dispose();
console.log(activityColorManager.isDisposed()); // prints: true

isDisposed()

Determines if the ActivityColorManager is disposed.

const = activityColorManager = // new pointer manager;
console.log(activityColorManager.isDisposed()); // prints: false