|  | @@ -28,7 +28,7 @@ import {
 | 
											
												
													
														|  |  import { getSelectedElements } from "../scene/selection";
 |  |  import { getSelectedElements } from "../scene/selection";
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  import { renderElement, renderElementToSvg } from "./renderElement";
 |  |  import { renderElement, renderElementToSvg } from "./renderElement";
 | 
											
												
													
														|  | -import colors from "../colors";
 |  | 
 | 
											
												
													
														|  | 
 |  | +import { getClientColors } from "../clients";
 | 
											
												
													
														|  |  import { isLinearElement } from "../element/typeChecks";
 |  |  import { isLinearElement } from "../element/typeChecks";
 | 
											
												
													
														|  |  import { LinearElementEditor } from "../element/linearElementEditor";
 |  |  import { LinearElementEditor } from "../element/linearElementEditor";
 | 
											
												
													
														|  |  import {
 |  |  import {
 | 
											
										
											
												
													
														|  | @@ -39,19 +39,6 @@ import {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  type HandlerRectanglesRet = keyof ReturnType<typeof handlerRectangles>;
 |  |  type HandlerRectanglesRet = keyof ReturnType<typeof handlerRectangles>;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -const colorsForClientId = (clientId: string) => {
 |  | 
 | 
											
												
													
														|  | -  // Naive way of getting an integer out of the clientId
 |  | 
 | 
											
												
													
														|  | -  const sum = clientId.split("").reduce((a, str) => a + str.charCodeAt(0), 0);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -  // Skip transparent background.
 |  | 
 | 
											
												
													
														|  | -  const backgrounds = colors.elementBackground.slice(1);
 |  | 
 | 
											
												
													
														|  | -  const strokes = colors.elementStroke.slice(1);
 |  | 
 | 
											
												
													
														|  | -  return {
 |  | 
 | 
											
												
													
														|  | -    background: backgrounds[sum % backgrounds.length],
 |  | 
 | 
											
												
													
														|  | -    stroke: strokes[sum % strokes.length],
 |  | 
 | 
											
												
													
														|  | -  };
 |  | 
 | 
											
												
													
														|  | -};
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |  const strokeRectWithRotation = (
 |  |  const strokeRectWithRotation = (
 | 
											
												
													
														|  |    context: CanvasRenderingContext2D,
 |  |    context: CanvasRenderingContext2D,
 | 
											
												
													
														|  |    x: number,
 |  |    x: number,
 | 
											
										
											
												
													
														|  | @@ -232,7 +219,7 @@ export const renderScene = (
 | 
											
												
													
														|  |        if (sceneState.remoteSelectedElementIds[element.id]) {
 |  |        if (sceneState.remoteSelectedElementIds[element.id]) {
 | 
											
												
													
														|  |          selectionColors.push(
 |  |          selectionColors.push(
 | 
											
												
													
														|  |            ...sceneState.remoteSelectedElementIds[element.id].map((socketId) => {
 |  |            ...sceneState.remoteSelectedElementIds[element.id].map((socketId) => {
 | 
											
												
													
														|  | -            const { background } = colorsForClientId(socketId);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            const { background } = getClientColors(socketId);
 | 
											
												
													
														|  |              return background;
 |  |              return background;
 | 
											
												
													
														|  |            }),
 |  |            }),
 | 
											
												
													
														|  |          );
 |  |          );
 | 
											
										
											
												
													
														|  | @@ -444,7 +431,7 @@ export const renderScene = (
 | 
											
												
													
														|  |      y = Math.max(y, 0);
 |  |      y = Math.max(y, 0);
 | 
											
												
													
														|  |      y = Math.min(y, normalizedCanvasHeight - height);
 |  |      y = Math.min(y, normalizedCanvasHeight - height);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    const { background, stroke } = colorsForClientId(clientId);
 |  | 
 | 
											
												
													
														|  | 
 |  | +    const { background, stroke } = getClientColors(clientId);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      const strokeStyle = context.strokeStyle;
 |  |      const strokeStyle = context.strokeStyle;
 | 
											
												
													
														|  |      const fillStyle = context.fillStyle;
 |  |      const fillStyle = context.fillStyle;
 |