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.
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. |
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);
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
Determines if the ActivityColorManager is disposed.
const = activityColorManager = // new pointer manager;
console.log(activityColorManager.isDisposed()); // prints: false