@babylonjs/gui 7.34.4 → 7.35.0
Sign up to get free protection for your applications and to get access to all the features.
- package/2D/FrameGraph/guiTask.js.map +1 -1
- package/2D/FrameGraph/renderGraphGUIBlock.js.map +1 -1
- package/2D/adtInstrumentation.js.map +1 -1
- package/2D/advancedDynamicTexture.d.ts +1 -1
- package/2D/advancedDynamicTexture.js.map +1 -1
- package/2D/controls/button.js.map +1 -1
- package/2D/controls/checkbox.js.map +1 -1
- package/2D/controls/colorpicker.js.map +1 -1
- package/2D/controls/container.js.map +1 -1
- package/2D/controls/control.js.map +1 -1
- package/2D/controls/displayGrid.js.map +1 -1
- package/2D/controls/ellipse.js.map +1 -1
- package/2D/controls/focusableButton.js.map +1 -1
- package/2D/controls/gradient/BaseGradient.js.map +1 -1
- package/2D/controls/grid.js.map +1 -1
- package/2D/controls/image.js.map +1 -1
- package/2D/controls/inputPassword.js.map +1 -1
- package/2D/controls/inputText.js.map +1 -1
- package/2D/controls/inputTextArea.js.map +1 -1
- package/2D/controls/line.js.map +1 -1
- package/2D/controls/multiLine.js.map +1 -1
- package/2D/controls/radioButton.js.map +1 -1
- package/2D/controls/rectangle.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
- package/2D/controls/selector.js.map +1 -1
- package/2D/controls/sliders/baseSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
- package/2D/controls/sliders/imageScrollBar.js.map +1 -1
- package/2D/controls/sliders/scrollBar.js.map +1 -1
- package/2D/controls/sliders/slider.js.map +1 -1
- package/2D/controls/stackPanel.js.map +1 -1
- package/2D/controls/statics.js.map +1 -1
- package/2D/controls/textBlock.js.map +1 -1
- package/2D/controls/textWrapper.js.map +1 -1
- package/2D/controls/toggleButton.js.map +1 -1
- package/2D/controls/virtualKeyboard.js.map +1 -1
- package/2D/math2D.js.map +1 -1
- package/2D/measure.js.map +1 -1
- package/2D/multiLinePoint.js.map +1 -1
- package/2D/style.js.map +1 -1
- package/2D/valueAndUnit.js.map +1 -1
- package/2D/xmlLoader.js.map +1 -1
- package/3D/behaviors/defaultBehavior.js.map +1 -1
- package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -1
- package/3D/controls/button3D.js.map +1 -1
- package/3D/controls/container3D.js.map +1 -1
- package/3D/controls/contentDisplay3D.js.map +1 -1
- package/3D/controls/control3D.js.map +1 -1
- package/3D/controls/cylinderPanel.js.map +1 -1
- package/3D/controls/holographicBackplate.js.map +1 -1
- package/3D/controls/holographicButton.js.map +1 -1
- package/3D/controls/holographicSlate.js.map +1 -1
- package/3D/controls/meshButton3D.js.map +1 -1
- package/3D/controls/nearMenu.js.map +1 -1
- package/3D/controls/planePanel.js.map +1 -1
- package/3D/controls/scatterPanel.js.map +1 -1
- package/3D/controls/slider3D.js.map +1 -1
- package/3D/controls/spherePanel.js.map +1 -1
- package/3D/controls/stackPanel3D.js.map +1 -1
- package/3D/controls/touchButton3D.js.map +1 -1
- package/3D/controls/touchHolographicButton.js.map +1 -1
- package/3D/controls/touchHolographicMenu.js.map +1 -1
- package/3D/controls/touchMeshButton3D.js.map +1 -1
- package/3D/controls/volumeBasedPanel.js.map +1 -1
- package/3D/gizmos/gizmoHandle.js.map +1 -1
- package/3D/gizmos/slateGizmo.js.map +1 -1
- package/3D/gui3DManager.js.map +1 -1
- package/3D/materials/fluent/fluentMaterial.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
- package/3D/materials/handle/handleMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackglowMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlFrontplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlInnerquadMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
- package/legacy/legacy.js.map +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"colorpicker.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/colorpicker.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAE/C,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAEjD,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,yCAAyC;AACzC,MAAM,OAAO,WAAY,SAAQ,OAAO;IAyBpC,iDAAiD;IAEjD,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,IAAW,KAAK,CAAC,KAAa;QAC1B,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO;SACV;QAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAE5B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEvC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC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L,CAAC,CAAC,CAAC;IACP,CAAC;;AAz9Cc,oBAAQ,GAAG,QAAQ,AAAX,CAAY;AA0BnC;IADC,SAAS,EAAE;wCAGX;AAiDD;IADC,SAAS,EAAE;wCAGX;AAsBD;IADC,SAAS,EAAE;yCAGX;AAoBD;IADC,SAAS,EAAE;uCAGX;AA81CL,aAAa,CAAC,yBAAyB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { Observable } from \"core/Misc/observable\";\r\nimport type { Vector2 } from \"core/Maths/math.vector\";\r\n\r\nimport { Control } from \"./control\";\r\nimport type { Measure } from \"../measure\";\r\nimport { InputText } from \"./inputText\";\r\nimport { Rectangle } from \"./rectangle\";\r\nimport { Button } from \"./button\";\r\nimport { Grid } from \"./grid\";\r\nimport type { AdvancedDynamicTexture } from \"../advancedDynamicTexture\";\r\nimport { TextBlock } from \"../controls/textBlock\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvas, ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport { EngineStore } from \"core/Engines/engineStore\";\r\n\r\n/** Class used to create color pickers */\r\nexport class ColorPicker extends Control {\r\n private static _Epsilon = 0.000001;\r\n private _colorWheelCanvas: ICanvas;\r\n\r\n private _value: Color3 = Color3.Red();\r\n private _tmpColor = new Color3();\r\n\r\n private _pointerStartedOnSquare = false;\r\n private _pointerStartedOnWheel = false;\r\n\r\n private _squareLeft = 0;\r\n private _squareTop = 0;\r\n private _squareSize = 0;\r\n\r\n private _h = 360;\r\n private _s = 1;\r\n private _v = 1;\r\n\r\n private _lastPointerDownId = -1;\r\n\r\n /**\r\n * Observable raised when the value changes\r\n */\r\n public onValueChangedObservable = new Observable<Color3>();\r\n\r\n /** Gets or sets the color of the color picker */\r\n @serialize()\r\n public get value(): Color3 {\r\n return this._value;\r\n }\r\n\r\n public set value(value: Color3) {\r\n if (this._value.equals(value)) {\r\n return;\r\n }\r\n\r\n this._value.copyFrom(value);\r\n\r\n this._value.toHSVToRef(this._tmpColor);\r\n\r\n this._h = this._tmpColor.r;\r\n this._s = Math.max(this._tmpColor.g, 0.00001);\r\n this._v = Math.max(this._tmpColor.b, 0.00001);\r\n\r\n this._markAsDirty();\r\n\r\n if (this._value.r <= ColorPicker._Epsilon) {\r\n this._value.r = 0;\r\n }\r\n\r\n if (this._value.g <= ColorPicker._Epsilon) {\r\n this._value.g = 0;\r\n }\r\n\r\n if (this._value.b <= ColorPicker._Epsilon) {\r\n this._value.b = 0;\r\n }\r\n\r\n if (this._value.r >= 1.0 - ColorPicker._Epsilon) {\r\n this._value.r = 1.0;\r\n }\r\n\r\n if (this._value.g >= 1.0 - ColorPicker._Epsilon) {\r\n this._value.g = 1.0;\r\n }\r\n\r\n if (this._value.b >= 1.0 - ColorPicker._Epsilon) {\r\n this._value.b = 1.0;\r\n }\r\n\r\n this.onValueChangedObservable.notifyObservers(this._value);\r\n }\r\n\r\n /**\r\n * Gets or sets control width\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public override get width(): string | number {\r\n return this._width.toString(this._host);\r\n }\r\n\r\n public override set width(value: string | number) {\r\n if (this._width.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._width.fromString(value)) {\r\n if (this._width.getValue(this._host) === 0) {\r\n value = \"1px\";\r\n this._width.fromString(value);\r\n }\r\n this._height.fromString(value);\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets control height\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public override get height(): string | number {\r\n return this._height.toString(this._host);\r\n }\r\n\r\n /** Gets or sets control height */\r\n public override set height(value: string | number) {\r\n if (this._height.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._height.fromString(value)) {\r\n if (this._height.getValue(this._host) === 0) {\r\n value = \"1px\";\r\n this._height.fromString(value);\r\n }\r\n this._width.fromString(value);\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /** Gets or sets control size */\r\n @serialize()\r\n public get size(): string | number {\r\n return this.width;\r\n }\r\n\r\n public set size(value: string | number) {\r\n this.width = value;\r\n }\r\n\r\n /**\r\n * Creates a new ColorPicker\r\n * @param name defines the control name\r\n */\r\n constructor(public override name?: string) {\r\n super(name);\r\n this.value = new Color3(0.88, 0.1, 0.1);\r\n this.size = \"200px\";\r\n this.isPointerBlocker = true;\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"ColorPicker\";\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected override _preMeasure(parentMeasure: Measure): void {\r\n if (parentMeasure.width < parentMeasure.height) {\r\n this._currentMeasure.height = parentMeasure.width;\r\n } else {\r\n this._currentMeasure.width = parentMeasure.height;\r\n }\r\n }\r\n\r\n private _updateSquareProps(): void {\r\n const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;\r\n const wheelThickness = radius * 0.2;\r\n const innerDiameter = (radius - wheelThickness) * 2;\r\n const squareSize = innerDiameter / Math.sqrt(2);\r\n const offset = radius - squareSize * 0.5;\r\n\r\n this._squareLeft = this._currentMeasure.left + offset;\r\n this._squareTop = this._currentMeasure.top + offset;\r\n this._squareSize = squareSize;\r\n }\r\n\r\n private _drawGradientSquare(hueValue: number, left: number, top: number, width: number, height: number, context: ICanvasRenderingContext) {\r\n const lgh = context.createLinearGradient(left, top, width + left, top);\r\n lgh.addColorStop(0, \"#fff\");\r\n lgh.addColorStop(1, \"hsl(\" + hueValue + \", 100%, 50%)\");\r\n\r\n context.fillStyle = lgh;\r\n context.fillRect(left, top, width, height);\r\n\r\n const lgv = context.createLinearGradient(left, top, left, height + top);\r\n lgv.addColorStop(0, \"rgba(0,0,0,0)\");\r\n lgv.addColorStop(1, \"#000\");\r\n\r\n context.fillStyle = lgv;\r\n context.fillRect(left, top, width, height);\r\n }\r\n\r\n private _drawCircle(centerX: number, centerY: number, radius: number, context: ICanvasRenderingContext) {\r\n context.beginPath();\r\n context.arc(centerX, centerY, radius + 1, 0, 2 * Math.PI, false);\r\n context.lineWidth = 3;\r\n context.strokeStyle = \"#333333\";\r\n context.stroke();\r\n context.beginPath();\r\n context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);\r\n context.lineWidth = 3;\r\n context.strokeStyle = \"#ffffff\";\r\n context.stroke();\r\n }\r\n\r\n private _createColorWheelCanvas(radius: number, thickness: number): ICanvas {\r\n // Shoudl abstract platform instead of using LastCreatedEngine\r\n const engine = EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n const canvas = engine.createCanvas(radius * 2, radius * 2);\r\n const context = canvas.getContext(\"2d\");\r\n const image = context.getImageData(0, 0, radius * 2, radius * 2);\r\n const data = image.data;\r\n\r\n const color = this._tmpColor;\r\n const maxDistSq = radius * radius;\r\n const innerRadius = radius - thickness;\r\n const minDistSq = innerRadius * innerRadius;\r\n\r\n for (let x = -radius; x < radius; x++) {\r\n for (let y = -radius; y < radius; y++) {\r\n const distSq = x * x + y * y;\r\n\r\n if (distSq > maxDistSq || distSq < minDistSq) {\r\n continue;\r\n }\r\n\r\n const dist = Math.sqrt(distSq);\r\n const ang = Math.atan2(y, x);\r\n\r\n Color3.HSVtoRGBToRef((ang * 180) / Math.PI + 180, dist / radius, 1, color);\r\n\r\n const index = (x + radius + (y + radius) * 2 * radius) * 4;\r\n\r\n data[index] = color.r * 255;\r\n data[index + 1] = color.g * 255;\r\n data[index + 2] = color.b * 255;\r\n let alphaRatio = (dist - innerRadius) / (radius - innerRadius);\r\n\r\n //apply less alpha to bigger color pickers\r\n let alphaAmount = 0.2;\r\n const maxAlpha = 0.2;\r\n const minAlpha = 0.04;\r\n const lowerRadius = 50;\r\n const upperRadius = 150;\r\n\r\n if (radius < lowerRadius) {\r\n alphaAmount = maxAlpha;\r\n } else if (radius > upperRadius) {\r\n alphaAmount = minAlpha;\r\n } else {\r\n alphaAmount = ((minAlpha - maxAlpha) * (radius - lowerRadius)) / (upperRadius - lowerRadius) + maxAlpha;\r\n }\r\n\r\n alphaRatio = (dist - innerRadius) / (radius - innerRadius);\r\n\r\n if (alphaRatio < alphaAmount) {\r\n data[index + 3] = 255 * (alphaRatio / alphaAmount);\r\n } else if (alphaRatio > 1 - alphaAmount) {\r\n data[index + 3] = 255 * (1.0 - (alphaRatio - (1 - alphaAmount)) / alphaAmount);\r\n } else {\r\n data[index + 3] = 255;\r\n }\r\n }\r\n }\r\n\r\n context.putImageData(image, 0, 0);\r\n\r\n return canvas;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _draw(context: ICanvasRenderingContext): void {\r\n context.save();\r\n\r\n this._applyStates(context);\r\n\r\n const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;\r\n const wheelThickness = radius * 0.2;\r\n const left = this._currentMeasure.left;\r\n const top = this._currentMeasure.top;\r\n\r\n if (!this._colorWheelCanvas || this._colorWheelCanvas.width != radius * 2) {\r\n this._colorWheelCanvas = this._createColorWheelCanvas(radius, wheelThickness);\r\n }\r\n\r\n this._updateSquareProps();\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n\r\n context.fillRect(this._squareLeft, this._squareTop, this._squareSize, this._squareSize);\r\n }\r\n\r\n context.drawImage(this._colorWheelCanvas, left, top);\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowBlur = 0;\r\n context.shadowOffsetX = 0;\r\n context.shadowOffsetY = 0;\r\n }\r\n\r\n this._drawGradientSquare(this._h, this._squareLeft, this._squareTop, this._squareSize, this._squareSize, context);\r\n\r\n let cx = this._squareLeft + this._squareSize * this._s;\r\n let cy = this._squareTop + this._squareSize * (1 - this._v);\r\n\r\n this._drawCircle(cx, cy, radius * 0.04, context);\r\n\r\n const dist = radius - wheelThickness * 0.5;\r\n cx = left + radius + Math.cos(((this._h - 180) * Math.PI) / 180) * dist;\r\n cy = top + radius + Math.sin(((this._h - 180) * Math.PI) / 180) * dist;\r\n this._drawCircle(cx, cy, wheelThickness * 0.35, context);\r\n\r\n context.restore();\r\n }\r\n\r\n // Events\r\n private _pointerIsDown = false;\r\n\r\n private _updateValueFromPointer(x: number, y: number): void {\r\n if (this._pointerStartedOnWheel) {\r\n const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;\r\n const centerX = radius + this._currentMeasure.left;\r\n const centerY = radius + this._currentMeasure.top;\r\n this._h = (Math.atan2(y - centerY, x - centerX) * 180) / Math.PI + 180;\r\n } else if (this._pointerStartedOnSquare) {\r\n this._updateSquareProps();\r\n this._s = (x - this._squareLeft) / this._squareSize;\r\n this._v = 1 - (y - this._squareTop) / this._squareSize;\r\n this._s = Math.min(this._s, 1);\r\n this._s = Math.max(this._s, ColorPicker._Epsilon);\r\n this._v = Math.min(this._v, 1);\r\n this._v = Math.max(this._v, ColorPicker._Epsilon);\r\n }\r\n\r\n Color3.HSVtoRGBToRef(this._h, this._s, this._v, this._tmpColor);\r\n\r\n this.value = this._tmpColor;\r\n }\r\n\r\n private _isPointOnSquare(x: number, y: number): boolean {\r\n this._updateSquareProps();\r\n\r\n const left = this._squareLeft;\r\n const top = this._squareTop;\r\n const size = this._squareSize;\r\n\r\n if (x >= left && x <= left + size && y >= top && y <= top + size) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private _isPointOnWheel(x: number, y: number): boolean {\r\n const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;\r\n const centerX = radius + this._currentMeasure.left;\r\n const centerY = radius + this._currentMeasure.top;\r\n const wheelThickness = radius * 0.2;\r\n const innerRadius = radius - wheelThickness;\r\n const radiusSq = radius * radius;\r\n const innerRadiusSq = innerRadius * innerRadius;\r\n\r\n const dx = x - centerX;\r\n const dy = y - centerY;\r\n\r\n const distSq = dx * dx + dy * dy;\r\n\r\n if (distSq <= radiusSq && distSq >= innerRadiusSq) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public override _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {\r\n return false;\r\n }\r\n\r\n if (this.isReadOnly) {\r\n return true;\r\n }\r\n\r\n this._pointerIsDown = true;\r\n\r\n this._pointerStartedOnSquare = false;\r\n this._pointerStartedOnWheel = false;\r\n\r\n // Invert transform\r\n this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition);\r\n\r\n const x = this._transformedPosition.x;\r\n const y = this._transformedPosition.y;\r\n\r\n if (this._isPointOnSquare(x, y)) {\r\n this._pointerStartedOnSquare = true;\r\n } else if (this._isPointOnWheel(x, y)) {\r\n this._pointerStartedOnWheel = true;\r\n }\r\n\r\n this._updateValueFromPointer(x, y);\r\n this._host._capturingControl[pointerId] = this;\r\n this._lastPointerDownId = pointerId;\r\n return true;\r\n }\r\n\r\n public override _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: PointerInfoBase): void {\r\n // Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)\r\n if (pointerId != this._lastPointerDownId) {\r\n return;\r\n }\r\n\r\n if (!this.isReadOnly) {\r\n // Invert transform\r\n this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition);\r\n\r\n const x = this._transformedPosition.x;\r\n const y = this._transformedPosition.y;\r\n\r\n if (this._pointerIsDown) {\r\n this._updateValueFromPointer(x, y);\r\n }\r\n }\r\n\r\n super._onPointerMove(target, coordinates, pointerId, pi);\r\n }\r\n\r\n public override _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean, pi: PointerInfoBase): void {\r\n this._pointerIsDown = false;\r\n\r\n delete this._host._capturingControl[pointerId];\r\n super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi);\r\n }\r\n\r\n public override _onCanvasBlur() {\r\n this._forcePointerUp();\r\n super._onCanvasBlur();\r\n }\r\n\r\n /**\r\n * This function expands the color picker by creating a color picker dialog with manual\r\n * color value input and the ability to save colors into an array to be used later in\r\n * subsequent launches of the dialogue.\r\n * @param advancedTexture defines the AdvancedDynamicTexture the dialog is assigned to\r\n * @param options defines size for dialog and options for saved colors. Also accepts last color picked as hex string and saved colors array as hex strings.\r\n * @param options.pickerWidth\r\n * @param options.pickerHeight\r\n * @param options.headerHeight\r\n * @param options.lastColor\r\n * @param options.swatchLimit\r\n * @param options.numSwatchesPerLine\r\n * @param options.savedColors\r\n * @returns picked color as a hex string and the saved colors array as hex strings.\r\n */\r\n public static ShowPickerDialogAsync(\r\n advancedTexture: AdvancedDynamicTexture,\r\n options: {\r\n pickerWidth?: string;\r\n pickerHeight?: string;\r\n headerHeight?: string;\r\n lastColor?: string;\r\n swatchLimit?: number;\r\n numSwatchesPerLine?: number;\r\n savedColors?: Array<string>;\r\n }\r\n ): Promise<{\r\n savedColors?: string[];\r\n pickedColor: string;\r\n }> {\r\n return new Promise((resolve) => {\r\n // Default options\r\n options.pickerWidth = options.pickerWidth || \"640px\";\r\n options.pickerHeight = options.pickerHeight || \"400px\";\r\n options.headerHeight = options.headerHeight || \"35px\";\r\n options.lastColor = options.lastColor || \"#000000\";\r\n options.swatchLimit = options.swatchLimit || 20;\r\n options.numSwatchesPerLine = options.numSwatchesPerLine || 10;\r\n\r\n // Window size settings\r\n const drawerMaxRows: number = options.swatchLimit / options.numSwatchesPerLine;\r\n const rawSwatchSize: number = parseFloat(<string>options.pickerWidth) / options.numSwatchesPerLine;\r\n const gutterSize: number = Math.floor(rawSwatchSize * 0.25);\r\n const colGutters: number = gutterSize * (options.numSwatchesPerLine + 1);\r\n const swatchSize: number = Math.floor((parseFloat(<string>options.pickerWidth) - colGutters) / options.numSwatchesPerLine);\r\n const drawerMaxSize: number = swatchSize * drawerMaxRows + gutterSize * (drawerMaxRows + 1);\r\n const containerSize: string = (parseInt(options.pickerHeight) + drawerMaxSize + Math.floor(swatchSize * 0.25)).toString() + \"px\";\r\n\r\n // Button Colors\r\n const buttonColor: string = \"#c0c0c0\";\r\n const buttonBackgroundColor: string = \"#535353\";\r\n const buttonBackgroundHoverColor: string = \"#414141\";\r\n const buttonBackgroundClickColor: string = \"515151\";\r\n const buttonDisabledColor: string = \"#555555\";\r\n const buttonDisabledBackgroundColor: string = \"#454545\";\r\n const currentSwatchesOutlineColor: string = \"#404040\";\r\n const luminanceLimitColor: Color3 = Color3.FromHexString(\"#dddddd\");\r\n const luminanceLimit: number = luminanceLimitColor.r + luminanceLimitColor.g + luminanceLimitColor.b;\r\n const iconColorDark: string = \"#aaaaaa\";\r\n const iconColorLight: string = \"#ffffff\";\r\n\r\n // Button settings\r\n let buttonFontSize: number;\r\n let butEdit: Button;\r\n\r\n // Input Text Colors\r\n const inputFieldLabels: string[] = [\"R\", \"G\", \"B\"];\r\n const inputTextBackgroundColor: string = \"#454545\";\r\n const inputTextColor: string = \"#f0f0f0\";\r\n\r\n // This int is used for naming swatches and serves as the index for calling them from the list\r\n let swatchNumber: number;\r\n\r\n // Menu Panel options. We need to know if the swatchDrawer exists so we can create it if needed.\r\n let swatchDrawer: Grid;\r\n let editSwatchMode: boolean = false;\r\n\r\n // Color InputText fields that will be updated upon value change\r\n let butSave: Button;\r\n let lastVal: string;\r\n let activeField: string;\r\n\r\n // Dialog menu container which will contain both the main dialogue window and the swatch drawer which opens once a color is saved.\r\n const dialogContainer: Grid = new Grid();\r\n dialogContainer.name = \"Dialog Container\";\r\n dialogContainer.width = options.pickerWidth;\r\n if (options.savedColors) {\r\n dialogContainer.height = containerSize;\r\n const topRow: number = parseInt(options.pickerHeight) / parseInt(containerSize);\r\n dialogContainer.addRowDefinition(topRow, false);\r\n dialogContainer.addRowDefinition(1.0 - topRow, false);\r\n } else {\r\n dialogContainer.height = options.pickerHeight;\r\n dialogContainer.addRowDefinition(1.0, false);\r\n }\r\n advancedTexture.addControl(dialogContainer);\r\n\r\n // Swatch drawer which contains all saved color buttons\r\n if (options.savedColors) {\r\n swatchDrawer = new Grid();\r\n swatchDrawer.name = \"Swatch Drawer\";\r\n swatchDrawer.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n swatchDrawer.background = buttonBackgroundColor;\r\n swatchDrawer.width = options.pickerWidth!;\r\n const initialRows: number = options.savedColors.length / options.numSwatchesPerLine;\r\n let gutterCount: number;\r\n if (initialRows == 0) {\r\n gutterCount = 0;\r\n } else {\r\n gutterCount = initialRows + 1;\r\n }\r\n swatchDrawer.height = (swatchSize * initialRows + gutterCount * gutterSize).toString() + \"px\";\r\n swatchDrawer.top = Math.floor(swatchSize * 0.25).toString() + \"px\";\r\n for (let i = 0; i < Math.ceil(options.savedColors.length / options.numSwatchesPerLine) * 2 + 1; i++) {\r\n if (i % 2 != 0) {\r\n swatchDrawer.addRowDefinition(swatchSize, true);\r\n } else {\r\n swatchDrawer.addRowDefinition(gutterSize, true);\r\n }\r\n }\r\n for (let i = 0; i < options.numSwatchesPerLine! * 2 + 1; i++) {\r\n if (i % 2 != 0) {\r\n swatchDrawer.addColumnDefinition(swatchSize, true);\r\n } else {\r\n swatchDrawer.addColumnDefinition(gutterSize, true);\r\n }\r\n }\r\n dialogContainer.addControl(swatchDrawer, 1, 0);\r\n }\r\n\r\n // Picker container\r\n const pickerPanel: Grid = new Grid();\r\n pickerPanel.name = \"Picker Panel\";\r\n pickerPanel.height = options.pickerHeight;\r\n const panelHead: number = parseInt(options.headerHeight) / parseInt(options.pickerHeight);\r\n const pickerPanelRows: number[] = [panelHead, 1.0 - panelHead];\r\n pickerPanel.addRowDefinition(pickerPanelRows[0], false);\r\n pickerPanel.addRowDefinition(pickerPanelRows[1], false);\r\n dialogContainer.addControl(pickerPanel, 0, 0);\r\n\r\n // Picker container header\r\n const header: Rectangle = new Rectangle();\r\n header.name = \"Dialogue Header Bar\";\r\n header.background = \"#cccccc\";\r\n header.thickness = 0;\r\n pickerPanel.addControl(header, 0, 0);\r\n\r\n // Header close button\r\n const closeButton: Button = Button.CreateSimpleButton(\"closeButton\", \"a\");\r\n closeButton.fontFamily = \"coreglyphs\";\r\n const headerColor3: Color3 = Color3.FromHexString(header.background);\r\n const closeIconColor = new Color3(1.0 - headerColor3.r, 1.0 - headerColor3.g, 1.0 - headerColor3.b);\r\n closeButton.color = closeIconColor.toHexString();\r\n closeButton.fontSize = Math.floor(parseInt(options.headerHeight!) * 0.6);\r\n closeButton.textBlock!.textVerticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n closeButton.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_RIGHT;\r\n closeButton.height = closeButton.width = options.headerHeight;\r\n closeButton.background = header.background;\r\n closeButton.thickness = 0;\r\n closeButton.pointerDownAnimation = () => {};\r\n closeButton.pointerUpAnimation = () => {\r\n closeButton.background = header.background;\r\n };\r\n closeButton.pointerEnterAnimation = () => {\r\n closeButton.color = header.background;\r\n closeButton.background = \"red\";\r\n };\r\n closeButton.pointerOutAnimation = () => {\r\n closeButton.color = closeIconColor.toHexString();\r\n closeButton.background = header.background;\r\n };\r\n closeButton.onPointerClickObservable.add(() => {\r\n closePicker(currentSwatch.background);\r\n });\r\n pickerPanel.addControl(closeButton, 0, 0);\r\n\r\n // Dialog container body\r\n const dialogBody: Grid = new Grid();\r\n dialogBody.name = \"Dialogue Body\";\r\n dialogBody.background = buttonBackgroundColor;\r\n const dialogBodyCols: number[] = [0.4375, 0.5625];\r\n dialogBody.addRowDefinition(1.0, false);\r\n dialogBody.addColumnDefinition(dialogBodyCols[0], false);\r\n dialogBody.addColumnDefinition(dialogBodyCols[1], false);\r\n pickerPanel.addControl(dialogBody, 1, 0);\r\n\r\n // Picker grid\r\n const pickerGrid: Grid = new Grid();\r\n pickerGrid.name = \"Picker Grid\";\r\n pickerGrid.addRowDefinition(0.85, false);\r\n pickerGrid.addRowDefinition(0.15, false);\r\n dialogBody.addControl(pickerGrid, 0, 0);\r\n\r\n // Picker control\r\n const picker = new ColorPicker();\r\n picker.name = \"GUI Color Picker\";\r\n if (options.pickerHeight < options.pickerWidth) {\r\n picker.width = 0.89;\r\n } else {\r\n picker.height = 0.89;\r\n }\r\n picker.value = Color3.FromHexString(options.lastColor);\r\n picker.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n picker.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n picker.onPointerDownObservable.add(() => {\r\n activeField = picker.name!;\r\n lastVal = \"\";\r\n editSwatches(false);\r\n });\r\n picker.onValueChangedObservable.add(function (value) {\r\n // value is a color3\r\n if (activeField == picker.name) {\r\n updateValues(value, picker.name);\r\n }\r\n });\r\n pickerGrid.addControl(picker, 0, 0);\r\n\r\n // Picker body right quarant\r\n const pickerBodyRight: Grid = new Grid();\r\n pickerBodyRight.name = \"Dialogue Right Half\";\r\n pickerBodyRight.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n const pickerBodyRightRows: number[] = [0.514, 0.486];\r\n pickerBodyRight.addRowDefinition(pickerBodyRightRows[0], false);\r\n pickerBodyRight.addRowDefinition(pickerBodyRightRows[1], false);\r\n dialogBody.addControl(pickerBodyRight, 1, 1);\r\n\r\n // Picker container swatches and buttons\r\n const pickerSwatchesButtons: Grid = new Grid();\r\n pickerSwatchesButtons.name = \"Swatches and Buttons\";\r\n const pickerButtonsCol: number[] = [0.417, 0.583];\r\n pickerSwatchesButtons.addRowDefinition(1.0, false);\r\n pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[0], false);\r\n pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[1], false);\r\n pickerBodyRight.addControl(pickerSwatchesButtons, 0, 0);\r\n\r\n // Picker Swatches quadrant\r\n const pickerSwatches: Grid = new Grid();\r\n pickerSwatches.name = \"New and Current Swatches\";\r\n const pickeSwatchesRows: number[] = [0.04, 0.16, 0.64, 0.16];\r\n pickerSwatches.addRowDefinition(pickeSwatchesRows[0], false);\r\n pickerSwatches.addRowDefinition(pickeSwatchesRows[1], false);\r\n pickerSwatches.addRowDefinition(pickeSwatchesRows[2], false);\r\n pickerSwatches.addRowDefinition(pickeSwatchesRows[3], false);\r\n pickerSwatchesButtons.addControl(pickerSwatches, 0, 0);\r\n\r\n // Active swatches\r\n const activeSwatches: Grid = new Grid();\r\n activeSwatches.name = \"Active Swatches\";\r\n activeSwatches.width = 0.67;\r\n activeSwatches.addRowDefinition(0.5, false);\r\n activeSwatches.addRowDefinition(0.5, false);\r\n pickerSwatches.addControl(activeSwatches, 2, 0);\r\n\r\n const labelWidth: number = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[0] * 0.11);\r\n const labelHeight: number = Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * pickeSwatchesRows[1] * 0.5);\r\n\r\n let labelTextSize: number;\r\n if (options.pickerWidth > options.pickerHeight) {\r\n labelTextSize = labelHeight;\r\n } else {\r\n labelTextSize = labelWidth;\r\n }\r\n // New color swatch and previous color button\r\n const newText: TextBlock = new TextBlock();\r\n newText.text = \"new\";\r\n newText.name = \"New Color Label\";\r\n newText.color = buttonColor;\r\n newText.fontSize = labelTextSize;\r\n pickerSwatches.addControl(newText, 1, 0);\r\n\r\n const newSwatch = new Rectangle();\r\n newSwatch.name = \"New Color Swatch\";\r\n newSwatch.background = options.lastColor;\r\n newSwatch.thickness = 0;\r\n activeSwatches.addControl(newSwatch, 0, 0);\r\n\r\n const currentSwatch: Button = Button.CreateSimpleButton(\"currentSwatch\", \"\");\r\n currentSwatch.background = options.lastColor;\r\n currentSwatch.thickness = 0;\r\n currentSwatch.onPointerClickObservable.add(() => {\r\n const revertColor = Color3.FromHexString(currentSwatch.background);\r\n updateValues(revertColor, currentSwatch.name!);\r\n editSwatches(false);\r\n });\r\n currentSwatch.pointerDownAnimation = () => {};\r\n currentSwatch.pointerUpAnimation = () => {};\r\n currentSwatch.pointerEnterAnimation = () => {};\r\n currentSwatch.pointerOutAnimation = () => {};\r\n activeSwatches.addControl(currentSwatch, 1, 0);\r\n\r\n const swatchOutline: Rectangle = new Rectangle();\r\n swatchOutline.name = \"Swatch Outline\";\r\n swatchOutline.width = 0.67;\r\n swatchOutline.thickness = 2;\r\n swatchOutline.color = currentSwatchesOutlineColor;\r\n swatchOutline.isHitTestVisible = false;\r\n pickerSwatches.addControl(swatchOutline, 2, 0);\r\n\r\n const currentText: TextBlock = new TextBlock();\r\n currentText.name = \"Current Color Label\";\r\n currentText.text = \"current\";\r\n currentText.color = buttonColor;\r\n currentText.fontSize = labelTextSize;\r\n pickerSwatches.addControl(currentText, 3, 0);\r\n\r\n // Buttons grid\r\n const buttonGrid: Grid = new Grid();\r\n buttonGrid.name = \"Button Grid\";\r\n buttonGrid.height = 0.8;\r\n const buttonGridRows: number = 1 / 3;\r\n buttonGrid.addRowDefinition(buttonGridRows, false);\r\n buttonGrid.addRowDefinition(buttonGridRows, false);\r\n buttonGrid.addRowDefinition(buttonGridRows, false);\r\n pickerSwatchesButtons.addControl(buttonGrid, 0, 1);\r\n\r\n // Determine pixel width and height for all buttons from overall panel dimensions\r\n const buttonWidth = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[1] * 0.67).toString() + \"px\";\r\n const buttonHeight =\r\n Math.floor(\r\n parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * (parseFloat(buttonGrid.height.toString()) / 100) * buttonGridRows * 0.7\r\n ).toString() + \"px\";\r\n\r\n // Determine button type size\r\n if (parseFloat(buttonWidth) > parseFloat(buttonHeight)) {\r\n buttonFontSize = Math.floor(parseFloat(buttonHeight) * 0.45);\r\n } else {\r\n buttonFontSize = Math.floor(parseFloat(buttonWidth) * 0.11);\r\n }\r\n\r\n // Panel Buttons\r\n const butOK: Button = Button.CreateSimpleButton(\"butOK\", \"OK\");\r\n butOK.width = buttonWidth;\r\n butOK.height = buttonHeight;\r\n butOK.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n butOK.thickness = 2;\r\n butOK.color = buttonColor;\r\n butOK.fontSize = buttonFontSize;\r\n butOK.background = buttonBackgroundColor;\r\n butOK.onPointerEnterObservable.add(() => {\r\n butOK.background = buttonBackgroundHoverColor;\r\n });\r\n butOK.onPointerOutObservable.add(() => {\r\n butOK.background = buttonBackgroundColor;\r\n });\r\n butOK.pointerDownAnimation = () => {\r\n butOK.background = buttonBackgroundClickColor;\r\n };\r\n butOK.pointerUpAnimation = () => {\r\n butOK.background = buttonBackgroundHoverColor;\r\n };\r\n butOK.onPointerClickObservable.add(() => {\r\n editSwatches(false);\r\n closePicker(newSwatch.background);\r\n });\r\n buttonGrid.addControl(butOK, 0, 0);\r\n\r\n const butCancel: Button = Button.CreateSimpleButton(\"butCancel\", \"Cancel\");\r\n butCancel.width = buttonWidth;\r\n butCancel.height = buttonHeight;\r\n butCancel.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n butCancel.thickness = 2;\r\n butCancel.color = buttonColor;\r\n butCancel.fontSize = buttonFontSize;\r\n butCancel.background = buttonBackgroundColor;\r\n butCancel.onPointerEnterObservable.add(() => {\r\n butCancel.background = buttonBackgroundHoverColor;\r\n });\r\n butCancel.onPointerOutObservable.add(() => {\r\n butCancel.background = buttonBackgroundColor;\r\n });\r\n butCancel.pointerDownAnimation = () => {\r\n butCancel.background = buttonBackgroundClickColor;\r\n };\r\n butCancel.pointerUpAnimation = () => {\r\n butCancel.background = buttonBackgroundHoverColor;\r\n };\r\n butCancel.onPointerClickObservable.add(() => {\r\n editSwatches(false);\r\n closePicker(currentSwatch.background);\r\n });\r\n buttonGrid.addControl(butCancel, 1, 0);\r\n\r\n if (options.savedColors) {\r\n butSave = Button.CreateSimpleButton(\"butSave\", \"Save\");\r\n butSave.width = buttonWidth;\r\n butSave.height = buttonHeight;\r\n butSave.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n butSave.thickness = 2;\r\n butSave.fontSize = buttonFontSize;\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n butSave.color = buttonColor;\r\n butSave.background = buttonBackgroundColor;\r\n } else {\r\n disableButton(butSave, true);\r\n }\r\n butSave.onPointerEnterObservable.add(() => {\r\n if (options.savedColors) {\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n butSave.background = buttonBackgroundHoverColor;\r\n }\r\n }\r\n });\r\n butSave.onPointerOutObservable.add(() => {\r\n if (options.savedColors) {\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n butSave.background = buttonBackgroundColor;\r\n }\r\n }\r\n });\r\n butSave.pointerDownAnimation = () => {\r\n if (options.savedColors) {\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n butSave.background = buttonBackgroundClickColor;\r\n }\r\n }\r\n };\r\n butSave.pointerUpAnimation = () => {\r\n if (options.savedColors) {\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n butSave.background = buttonBackgroundHoverColor;\r\n }\r\n }\r\n };\r\n butSave.onPointerClickObservable.add(() => {\r\n if (options.savedColors) {\r\n if (options.savedColors.length == 0) {\r\n setEditButtonVisibility(true);\r\n }\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n updateSwatches(newSwatch.background, butSave);\r\n }\r\n editSwatches(false);\r\n }\r\n });\r\n if (options.savedColors.length > 0) {\r\n setEditButtonVisibility(true);\r\n }\r\n buttonGrid.addControl(butSave, 2, 0);\r\n }\r\n\r\n // Picker color values input\r\n const pickerColorValues: Grid = new Grid();\r\n pickerColorValues.name = \"Dialog Lower Right\";\r\n pickerColorValues.addRowDefinition(0.02, false);\r\n pickerColorValues.addRowDefinition(0.63, false);\r\n pickerColorValues.addRowDefinition(0.21, false);\r\n pickerColorValues.addRowDefinition(0.14, false);\r\n pickerBodyRight.addControl(pickerColorValues, 1, 0);\r\n\r\n // RGB values text boxes\r\n const currentColor = Color3.FromHexString(options.lastColor);\r\n const rgbValuesQuadrant: Grid = new Grid();\r\n rgbValuesQuadrant.name = \"RGB Values\";\r\n rgbValuesQuadrant.width = 0.82;\r\n rgbValuesQuadrant.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n rgbValuesQuadrant.addRowDefinition(1 / 3, false);\r\n rgbValuesQuadrant.addRowDefinition(1 / 3, false);\r\n rgbValuesQuadrant.addRowDefinition(1 / 3, false);\r\n rgbValuesQuadrant.addColumnDefinition(0.1, false);\r\n rgbValuesQuadrant.addColumnDefinition(0.2, false);\r\n rgbValuesQuadrant.addColumnDefinition(0.7, false);\r\n pickerColorValues.addControl(rgbValuesQuadrant, 1, 0);\r\n\r\n for (let i = 0; i < inputFieldLabels.length; i++) {\r\n const labelText: TextBlock = new TextBlock();\r\n labelText.text = inputFieldLabels[i];\r\n labelText.color = buttonColor;\r\n labelText.fontSize = buttonFontSize;\r\n rgbValuesQuadrant.addControl(labelText, i, 0);\r\n }\r\n\r\n // Input fields for RGB values\r\n const rValInt = new InputText();\r\n rValInt.width = 0.83;\r\n rValInt.height = 0.72;\r\n rValInt.name = \"rIntField\";\r\n rValInt.fontSize = buttonFontSize;\r\n rValInt.text = (currentColor.r * 255).toString();\r\n rValInt.color = inputTextColor;\r\n rValInt.background = inputTextBackgroundColor;\r\n rValInt.onFocusObservable.add(() => {\r\n activeField = rValInt.name!;\r\n lastVal = rValInt.text;\r\n editSwatches(false);\r\n });\r\n rValInt.onBlurObservable.add(() => {\r\n if (rValInt.text == \"\") {\r\n rValInt.text = \"0\";\r\n }\r\n updateInt(rValInt, \"r\");\r\n if (activeField == rValInt.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n rValInt.onTextChangedObservable.add(() => {\r\n if (activeField == rValInt.name) {\r\n updateInt(rValInt, \"r\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(rValInt, 0, 1);\r\n\r\n const gValInt = new InputText();\r\n gValInt.width = 0.83;\r\n gValInt.height = 0.72;\r\n gValInt.name = \"gIntField\";\r\n gValInt.fontSize = buttonFontSize;\r\n gValInt.text = (currentColor.g * 255).toString();\r\n gValInt.color = inputTextColor;\r\n gValInt.background = inputTextBackgroundColor;\r\n gValInt.onFocusObservable.add(() => {\r\n activeField = gValInt.name!;\r\n lastVal = gValInt.text;\r\n editSwatches(false);\r\n });\r\n gValInt.onBlurObservable.add(() => {\r\n if (gValInt.text == \"\") {\r\n gValInt.text = \"0\";\r\n }\r\n updateInt(gValInt, \"g\");\r\n if (activeField == gValInt.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n gValInt.onTextChangedObservable.add(() => {\r\n if (activeField == gValInt.name) {\r\n updateInt(gValInt, \"g\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(gValInt, 1, 1);\r\n\r\n const bValInt = new InputText();\r\n bValInt.width = 0.83;\r\n bValInt.height = 0.72;\r\n bValInt.name = \"bIntField\";\r\n bValInt.fontSize = buttonFontSize;\r\n bValInt.text = (currentColor.b * 255).toString();\r\n bValInt.color = inputTextColor;\r\n bValInt.background = inputTextBackgroundColor;\r\n bValInt.onFocusObservable.add(() => {\r\n activeField = bValInt.name!;\r\n lastVal = bValInt.text;\r\n editSwatches(false);\r\n });\r\n bValInt.onBlurObservable.add(() => {\r\n if (bValInt.text == \"\") {\r\n bValInt.text = \"0\";\r\n }\r\n updateInt(bValInt, \"b\");\r\n if (activeField == bValInt.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n bValInt.onTextChangedObservable.add(() => {\r\n if (activeField == bValInt.name) {\r\n updateInt(bValInt, \"b\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(bValInt, 2, 1);\r\n\r\n const rValDec = new InputText();\r\n rValDec.width = 0.95;\r\n rValDec.height = 0.72;\r\n rValDec.name = \"rDecField\";\r\n rValDec.fontSize = buttonFontSize;\r\n rValDec.text = currentColor.r.toString();\r\n rValDec.color = inputTextColor;\r\n rValDec.background = inputTextBackgroundColor;\r\n rValDec.onFocusObservable.add(() => {\r\n activeField = rValDec.name!;\r\n lastVal = rValDec.text;\r\n editSwatches(false);\r\n });\r\n rValDec.onBlurObservable.add(() => {\r\n if (parseFloat(rValDec.text) == 0 || rValDec.text == \"\") {\r\n rValDec.text = \"0\";\r\n updateFloat(rValDec, \"r\");\r\n }\r\n if (activeField == rValDec.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n rValDec.onTextChangedObservable.add(() => {\r\n if (activeField == rValDec.name) {\r\n updateFloat(rValDec, \"r\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(rValDec, 0, 2);\r\n\r\n const gValDec = new InputText();\r\n gValDec.width = 0.95;\r\n gValDec.height = 0.72;\r\n gValDec.name = \"gDecField\";\r\n gValDec.fontSize = buttonFontSize;\r\n gValDec.text = currentColor.g.toString();\r\n gValDec.color = inputTextColor;\r\n gValDec.background = inputTextBackgroundColor;\r\n gValDec.onFocusObservable.add(() => {\r\n activeField = gValDec.name!;\r\n lastVal = gValDec.text;\r\n editSwatches(false);\r\n });\r\n gValDec.onBlurObservable.add(() => {\r\n if (parseFloat(gValDec.text) == 0 || gValDec.text == \"\") {\r\n gValDec.text = \"0\";\r\n updateFloat(gValDec, \"g\");\r\n }\r\n if (activeField == gValDec.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n gValDec.onTextChangedObservable.add(() => {\r\n if (activeField == gValDec.name) {\r\n updateFloat(gValDec, \"g\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(gValDec, 1, 2);\r\n\r\n const bValDec = new InputText();\r\n bValDec.width = 0.95;\r\n bValDec.height = 0.72;\r\n bValDec.name = \"bDecField\";\r\n bValDec.fontSize = buttonFontSize;\r\n bValDec.text = currentColor.b.toString();\r\n bValDec.color = inputTextColor;\r\n bValDec.background = inputTextBackgroundColor;\r\n bValDec.onFocusObservable.add(() => {\r\n activeField = bValDec.name!;\r\n lastVal = bValDec.text;\r\n editSwatches(false);\r\n });\r\n bValDec.onBlurObservable.add(() => {\r\n if (parseFloat(bValDec.text) == 0 || bValDec.text == \"\") {\r\n bValDec.text = \"0\";\r\n updateFloat(bValDec, \"b\");\r\n }\r\n if (activeField == bValDec.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n bValDec.onTextChangedObservable.add(() => {\r\n if (activeField == bValDec.name) {\r\n updateFloat(bValDec, \"b\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(bValDec, 2, 2);\r\n\r\n // Hex value input\r\n const hexValueQuadrant: Grid = new Grid();\r\n hexValueQuadrant.name = \"Hex Value\";\r\n hexValueQuadrant.width = 0.82;\r\n hexValueQuadrant.addRowDefinition(1.0, false);\r\n hexValueQuadrant.addColumnDefinition(0.1, false);\r\n hexValueQuadrant.addColumnDefinition(0.9, false);\r\n pickerColorValues.addControl(hexValueQuadrant, 2, 0);\r\n\r\n const labelText: TextBlock = new TextBlock();\r\n labelText.text = \"#\";\r\n labelText.color = buttonColor;\r\n labelText.fontSize = buttonFontSize;\r\n hexValueQuadrant.addControl(labelText, 0, 0);\r\n\r\n const hexVal = new InputText();\r\n hexVal.width = 0.96;\r\n hexVal.height = 0.72;\r\n hexVal.name = \"hexField\";\r\n hexVal.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n hexVal.fontSize = buttonFontSize;\r\n const minusPound = options.lastColor.split(\"#\");\r\n hexVal.text = minusPound[1];\r\n hexVal.color = inputTextColor;\r\n hexVal.background = inputTextBackgroundColor;\r\n hexVal.onFocusObservable.add(() => {\r\n activeField = hexVal.name!;\r\n lastVal = hexVal.text;\r\n editSwatches(false);\r\n });\r\n hexVal.onBlurObservable.add(() => {\r\n if (hexVal.text.length == 3) {\r\n const val = hexVal.text.split(\"\");\r\n hexVal.text = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];\r\n }\r\n if (hexVal.text == \"\") {\r\n hexVal.text = \"000000\";\r\n updateValues(Color3.FromHexString(hexVal.text), \"b\");\r\n }\r\n if (activeField == hexVal.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n hexVal.onTextChangedObservable.add(() => {\r\n let newHexValue: string = hexVal.text;\r\n const checkHex: boolean = /[^0-9A-F]/i.test(newHexValue);\r\n if ((hexVal.text.length > 6 || checkHex) && activeField == hexVal.name) {\r\n hexVal.text = lastVal;\r\n } else {\r\n if (hexVal.text.length < 6) {\r\n const leadingZero: number = 6 - hexVal.text.length;\r\n for (let i = 0; i < leadingZero; i++) {\r\n newHexValue = \"0\" + newHexValue;\r\n }\r\n }\r\n if (hexVal.text.length == 3) {\r\n const val: string[] = hexVal.text.split(\"\");\r\n newHexValue = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];\r\n }\r\n newHexValue = \"#\" + newHexValue;\r\n if (activeField == hexVal.name) {\r\n lastVal = hexVal.text;\r\n updateValues(Color3.FromHexString(newHexValue), hexVal.name);\r\n }\r\n }\r\n });\r\n hexValueQuadrant.addControl(hexVal, 0, 1);\r\n\r\n if (options.savedColors && options.savedColors.length > 0) {\r\n updateSwatches(\"\", butSave!);\r\n }\r\n\r\n /**\r\n * Will update all values for InputText and ColorPicker controls based on the BABYLON.Color3 passed to this function.\r\n * Each InputText control and the ColorPicker control will be tested to see if they are the activeField and if they\r\n * are will receive no update. This is to prevent the input from the user being overwritten.\r\n * @param value\r\n * @param inputField\r\n */\r\n function updateValues(value: Color3, inputField: string) {\r\n activeField = inputField;\r\n const pickedColor: string = value.toHexString();\r\n newSwatch.background = pickedColor;\r\n if (rValInt.name != activeField) {\r\n rValInt.text = Math.floor(value.r * 255).toString();\r\n }\r\n if (gValInt.name != activeField) {\r\n gValInt.text = Math.floor(value.g * 255).toString();\r\n }\r\n if (bValInt.name != activeField) {\r\n bValInt.text = Math.floor(value.b * 255).toString();\r\n }\r\n if (rValDec.name != activeField) {\r\n rValDec.text = value.r.toString();\r\n }\r\n if (gValDec.name != activeField) {\r\n gValDec.text = value.g.toString();\r\n }\r\n if (bValDec.name != activeField) {\r\n bValDec.text = value.b.toString();\r\n }\r\n if (hexVal.name != activeField) {\r\n const minusPound: string[] = pickedColor.split(\"#\");\r\n hexVal.text = minusPound[1];\r\n }\r\n if (picker.name != activeField) {\r\n picker.value = value;\r\n }\r\n }\r\n\r\n // When the user enters an integer for R, G, or B we check to make sure it is a valid number and replace if not.\r\n function updateInt(field: InputText, channel: string) {\r\n let newValue: string = field.text;\r\n const checkVal: boolean = /[^0-9]/g.test(newValue);\r\n if (checkVal) {\r\n field.text = lastVal;\r\n return;\r\n } else {\r\n if (newValue != \"\") {\r\n if (Math.floor(parseInt(newValue)) < 0) {\r\n newValue = \"0\";\r\n } else if (Math.floor(parseInt(newValue)) > 255) {\r\n newValue = \"255\";\r\n } else if (isNaN(parseInt(newValue))) {\r\n newValue = \"0\";\r\n }\r\n }\r\n if (activeField == field.name) {\r\n lastVal = newValue;\r\n }\r\n }\r\n if (newValue != \"\") {\r\n newValue = parseInt(newValue).toString();\r\n field.text = newValue;\r\n const newSwatchRGB: Color3 = Color3.FromHexString(newSwatch.background);\r\n if (activeField == field.name) {\r\n if (channel == \"r\") {\r\n updateValues(new Color3(parseInt(newValue) / 255, newSwatchRGB.g, newSwatchRGB.b), field.name);\r\n } else if (channel == \"g\") {\r\n updateValues(new Color3(newSwatchRGB.r, parseInt(newValue) / 255, newSwatchRGB.b), field.name);\r\n } else {\r\n updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, parseInt(newValue) / 255), field.name);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // When the user enters a float for R, G, or B we check to make sure it is a valid number and replace if not.\r\n function updateFloat(field: InputText, channel: string) {\r\n let newValue: string = field.text;\r\n const checkVal: boolean = /[^0-9.]/g.test(newValue);\r\n if (checkVal) {\r\n field.text = lastVal;\r\n return;\r\n } else {\r\n if (newValue != \"\" && newValue != \".\" && parseFloat(newValue) != 0) {\r\n if (parseFloat(newValue) < 0.0) {\r\n newValue = \"0.0\";\r\n } else if (parseFloat(newValue) > 1.0) {\r\n newValue = \"1.0\";\r\n } else if (isNaN(parseFloat(newValue))) {\r\n newValue = \"0.0\";\r\n }\r\n }\r\n if (activeField == field.name) {\r\n lastVal = newValue;\r\n }\r\n }\r\n if (newValue != \"\" && newValue != \".\" && parseFloat(newValue) != 0) {\r\n newValue = parseFloat(newValue).toString();\r\n field.text = newValue;\r\n } else {\r\n newValue = \"0.0\";\r\n }\r\n const newSwatchRGB = Color3.FromHexString(newSwatch.background);\r\n if (activeField == field.name) {\r\n if (channel == \"r\") {\r\n updateValues(new Color3(parseFloat(newValue), newSwatchRGB.g, newSwatchRGB.b), field.name);\r\n } else if (channel == \"g\") {\r\n updateValues(new Color3(newSwatchRGB.r, parseFloat(newValue), newSwatchRGB.b), field.name);\r\n } else {\r\n updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, parseFloat(newValue)), field.name);\r\n }\r\n }\r\n }\r\n\r\n // Removes the current index from the savedColors array. Drawer can then be regenerated.\r\n function deleteSwatch(index: number) {\r\n if (options.savedColors) {\r\n options.savedColors.splice(index, 1);\r\n }\r\n if (options.savedColors && options.savedColors.length == 0) {\r\n setEditButtonVisibility(false);\r\n editSwatchMode = false;\r\n }\r\n }\r\n\r\n // Creates and styles an individual swatch when updateSwatches is called.\r\n function createSwatch() {\r\n if (options.savedColors && options.savedColors[swatchNumber]) {\r\n let icon: string;\r\n if (editSwatchMode) {\r\n icon = \"b\";\r\n } else {\r\n icon = \"\";\r\n }\r\n const swatch: Button = Button.CreateSimpleButton(\"Swatch_\" + swatchNumber, icon);\r\n swatch.fontFamily = \"coreglyphs\";\r\n const swatchColor: Color3 = Color3.FromHexString(options.savedColors[swatchNumber]);\r\n const swatchLuminence: number = swatchColor.r + swatchColor.g + swatchColor.b;\r\n\r\n // Set color of outline and textBlock based on luminance of the color swatch so feedback always visible\r\n if (swatchLuminence > luminanceLimit) {\r\n swatch.color = iconColorDark;\r\n } else {\r\n swatch.color = iconColorLight;\r\n }\r\n swatch.fontSize = Math.floor(swatchSize * 0.7);\r\n swatch.textBlock!.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n swatch.height = swatch.width = swatchSize.toString() + \"px\";\r\n swatch.background = options.savedColors[swatchNumber];\r\n swatch.thickness = 2;\r\n const metadata = swatchNumber;\r\n swatch.pointerDownAnimation = () => {\r\n swatch.thickness = 4;\r\n };\r\n swatch.pointerUpAnimation = () => {\r\n swatch.thickness = 3;\r\n };\r\n swatch.pointerEnterAnimation = () => {\r\n swatch.thickness = 3;\r\n };\r\n swatch.pointerOutAnimation = () => {\r\n swatch.thickness = 2;\r\n };\r\n swatch.onPointerClickObservable.add(() => {\r\n if (!editSwatchMode) {\r\n if (options.savedColors) {\r\n updateValues(Color3.FromHexString(options.savedColors[metadata]), swatch.name!);\r\n }\r\n } else {\r\n deleteSwatch(metadata);\r\n updateSwatches(\"\", butSave);\r\n }\r\n });\r\n return swatch;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n // Mode switch to render button text and close symbols on swatch controls\r\n function editSwatches(mode?: boolean) {\r\n if (mode !== undefined) {\r\n editSwatchMode = mode;\r\n }\r\n let thisButton: Button;\r\n if (editSwatchMode) {\r\n for (let i = 0; i < swatchDrawer.children.length; i++) {\r\n thisButton = swatchDrawer.children[i] as Button;\r\n thisButton.textBlock!.text = \"b\";\r\n }\r\n if (butEdit !== undefined) {\r\n butEdit.textBlock!.text = \"Done\";\r\n }\r\n } else {\r\n for (let i = 0; i < swatchDrawer.children.length; i++) {\r\n thisButton = swatchDrawer.children[i] as Button;\r\n thisButton.textBlock!.text = \"\";\r\n }\r\n if (butEdit !== undefined) {\r\n butEdit.textBlock!.text = \"Edit\";\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * When Save Color button is pressed this function will first create a swatch drawer if one is not already\r\n * made. Then all controls are removed from the drawer and we step through the savedColors array and\r\n * creates one swatch per color. It will also set the height of the drawer control based on how many\r\n * saved colors there are and how many can be stored per row.\r\n * @param color\r\n * @param button\r\n */\r\n function updateSwatches(color: string, button: Button) {\r\n if (options.savedColors) {\r\n if (color != \"\") {\r\n options.savedColors.push(color);\r\n }\r\n swatchNumber = 0;\r\n swatchDrawer.clearControls();\r\n const rowCount: number = Math.ceil(options.savedColors.length / options.numSwatchesPerLine!);\r\n let gutterCount: number;\r\n if (rowCount == 0) {\r\n gutterCount = 0;\r\n } else {\r\n gutterCount = rowCount + 1;\r\n }\r\n if (swatchDrawer.rowCount != rowCount + gutterCount) {\r\n const currentRows: number = swatchDrawer.rowCount;\r\n for (let i = 0; i < currentRows; i++) {\r\n swatchDrawer.removeRowDefinition(0);\r\n }\r\n for (let i = 0; i < rowCount + gutterCount; i++) {\r\n if (i % 2) {\r\n swatchDrawer.addRowDefinition(swatchSize, true);\r\n } else {\r\n swatchDrawer.addRowDefinition(gutterSize, true);\r\n }\r\n }\r\n }\r\n swatchDrawer.height = (swatchSize * rowCount + gutterCount * gutterSize).toString() + \"px\";\r\n\r\n for (let y = 1, thisRow = 1; y < rowCount + gutterCount; y += 2, thisRow++) {\r\n // Determine number of buttons to create per row based on the button limit per row and number of saved colors\r\n let totalButtonsThisRow: number;\r\n if (options.savedColors.length > thisRow * options.numSwatchesPerLine!) {\r\n totalButtonsThisRow = options.numSwatchesPerLine!;\r\n } else {\r\n totalButtonsThisRow = options.savedColors.length - (thisRow - 1) * options.numSwatchesPerLine!;\r\n }\r\n const buttonIterations: number = Math.min(Math.max(totalButtonsThisRow, 0), options.numSwatchesPerLine!);\r\n for (let x = 0, w = 1; x < buttonIterations; x++) {\r\n if (x > options.numSwatchesPerLine!) {\r\n continue;\r\n }\r\n const swatch: Button | null = createSwatch();\r\n if (swatch != null) {\r\n swatchDrawer.addControl(swatch, y, w);\r\n w += 2;\r\n swatchNumber++;\r\n } else {\r\n continue;\r\n }\r\n }\r\n }\r\n if (options.savedColors.length >= options.swatchLimit!) {\r\n disableButton(button, true);\r\n } else {\r\n disableButton(button, false);\r\n }\r\n }\r\n }\r\n\r\n // Shows or hides edit swatches button depending on if there are saved swatches\r\n function setEditButtonVisibility(enableButton: boolean) {\r\n if (enableButton) {\r\n butEdit = Button.CreateSimpleButton(\"butEdit\", \"Edit\");\r\n butEdit.width = buttonWidth;\r\n butEdit.height = buttonHeight;\r\n butEdit.left = Math.floor(parseInt(buttonWidth) * 0.1).toString() + \"px\";\r\n butEdit.top = (parseFloat(butEdit.left) * -1).toString() + \"px\";\r\n butEdit.verticalAlignment = Control.VERTICAL_ALIGNMENT_BOTTOM;\r\n butEdit.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n butEdit.thickness = 2;\r\n butEdit.color = buttonColor;\r\n butEdit.fontSize = buttonFontSize;\r\n butEdit.background = buttonBackgroundColor;\r\n butEdit.onPointerEnterObservable.add(() => {\r\n butEdit.background = buttonBackgroundHoverColor;\r\n });\r\n butEdit.onPointerOutObservable.add(() => {\r\n butEdit.background = buttonBackgroundColor;\r\n });\r\n butEdit.pointerDownAnimation = () => {\r\n butEdit.background = buttonBackgroundClickColor;\r\n };\r\n butEdit.pointerUpAnimation = () => {\r\n butEdit.background = buttonBackgroundHoverColor;\r\n };\r\n butEdit.onPointerClickObservable.add(() => {\r\n if (editSwatchMode) {\r\n editSwatchMode = false;\r\n } else {\r\n editSwatchMode = true;\r\n }\r\n editSwatches();\r\n });\r\n pickerGrid.addControl(butEdit, 1, 0);\r\n } else {\r\n pickerGrid.removeControl(butEdit);\r\n }\r\n }\r\n\r\n // Called when the user hits the limit of saved colors in the drawer.\r\n function disableButton(button: Button, disabled: boolean) {\r\n if (disabled) {\r\n button.color = buttonDisabledColor;\r\n button.background = buttonDisabledBackgroundColor;\r\n } else {\r\n button.color = buttonColor;\r\n button.background = buttonBackgroundColor;\r\n }\r\n }\r\n\r\n // Passes last chosen color back to scene and kills dialog by removing from AdvancedDynamicTexture\r\n function closePicker(color: string) {\r\n if (options.savedColors && options.savedColors.length > 0) {\r\n resolve({\r\n savedColors: options.savedColors,\r\n pickedColor: color,\r\n });\r\n } else {\r\n resolve({\r\n pickedColor: color,\r\n });\r\n }\r\n advancedTexture.removeControl(dialogContainer);\r\n }\r\n });\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.ColorPicker\", ColorPicker);\r\n"]}
|
1
|
+
{"version":3,"file":"colorpicker.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/colorpicker.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAE/C,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAEjD,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,yCAAyC;AACzC,MAAM,OAAO,WAAY,SAAQ,OAAO;IAyBpC,iDAAiD;IAEjD,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,IAAW,KAAK,CAAC,KAAa;QAC1B,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO;QACX,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAE5B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEvC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC,EAAE,GAA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","sourcesContent":["import { Observable } from \"core/Misc/observable\";\r\nimport type { Vector2 } from \"core/Maths/math.vector\";\r\n\r\nimport { Control } from \"./control\";\r\nimport type { Measure } from \"../measure\";\r\nimport { InputText } from \"./inputText\";\r\nimport { Rectangle } from \"./rectangle\";\r\nimport { Button } from \"./button\";\r\nimport { Grid } from \"./grid\";\r\nimport type { AdvancedDynamicTexture } from \"../advancedDynamicTexture\";\r\nimport { TextBlock } from \"../controls/textBlock\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvas, ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport { EngineStore } from \"core/Engines/engineStore\";\r\n\r\n/** Class used to create color pickers */\r\nexport class ColorPicker extends Control {\r\n private static _Epsilon = 0.000001;\r\n private _colorWheelCanvas: ICanvas;\r\n\r\n private _value: Color3 = Color3.Red();\r\n private _tmpColor = new Color3();\r\n\r\n private _pointerStartedOnSquare = false;\r\n private _pointerStartedOnWheel = false;\r\n\r\n private _squareLeft = 0;\r\n private _squareTop = 0;\r\n private _squareSize = 0;\r\n\r\n private _h = 360;\r\n private _s = 1;\r\n private _v = 1;\r\n\r\n private _lastPointerDownId = -1;\r\n\r\n /**\r\n * Observable raised when the value changes\r\n */\r\n public onValueChangedObservable = new Observable<Color3>();\r\n\r\n /** Gets or sets the color of the color picker */\r\n @serialize()\r\n public get value(): Color3 {\r\n return this._value;\r\n }\r\n\r\n public set value(value: Color3) {\r\n if (this._value.equals(value)) {\r\n return;\r\n }\r\n\r\n this._value.copyFrom(value);\r\n\r\n this._value.toHSVToRef(this._tmpColor);\r\n\r\n this._h = this._tmpColor.r;\r\n this._s = Math.max(this._tmpColor.g, 0.00001);\r\n this._v = Math.max(this._tmpColor.b, 0.00001);\r\n\r\n this._markAsDirty();\r\n\r\n if (this._value.r <= ColorPicker._Epsilon) {\r\n this._value.r = 0;\r\n }\r\n\r\n if (this._value.g <= ColorPicker._Epsilon) {\r\n this._value.g = 0;\r\n }\r\n\r\n if (this._value.b <= ColorPicker._Epsilon) {\r\n this._value.b = 0;\r\n }\r\n\r\n if (this._value.r >= 1.0 - ColorPicker._Epsilon) {\r\n this._value.r = 1.0;\r\n }\r\n\r\n if (this._value.g >= 1.0 - ColorPicker._Epsilon) {\r\n this._value.g = 1.0;\r\n }\r\n\r\n if (this._value.b >= 1.0 - ColorPicker._Epsilon) {\r\n this._value.b = 1.0;\r\n }\r\n\r\n this.onValueChangedObservable.notifyObservers(this._value);\r\n }\r\n\r\n /**\r\n * Gets or sets control width\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public override get width(): string | number {\r\n return this._width.toString(this._host);\r\n }\r\n\r\n public override set width(value: string | number) {\r\n if (this._width.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._width.fromString(value)) {\r\n if (this._width.getValue(this._host) === 0) {\r\n value = \"1px\";\r\n this._width.fromString(value);\r\n }\r\n this._height.fromString(value);\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets control height\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/gui#position-and-size\r\n */\r\n @serialize()\r\n public override get height(): string | number {\r\n return this._height.toString(this._host);\r\n }\r\n\r\n /** Gets or sets control height */\r\n public override set height(value: string | number) {\r\n if (this._height.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._height.fromString(value)) {\r\n if (this._height.getValue(this._host) === 0) {\r\n value = \"1px\";\r\n this._height.fromString(value);\r\n }\r\n this._width.fromString(value);\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /** Gets or sets control size */\r\n @serialize()\r\n public get size(): string | number {\r\n return this.width;\r\n }\r\n\r\n public set size(value: string | number) {\r\n this.width = value;\r\n }\r\n\r\n /**\r\n * Creates a new ColorPicker\r\n * @param name defines the control name\r\n */\r\n constructor(public override name?: string) {\r\n super(name);\r\n this.value = new Color3(0.88, 0.1, 0.1);\r\n this.size = \"200px\";\r\n this.isPointerBlocker = true;\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"ColorPicker\";\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected override _preMeasure(parentMeasure: Measure): void {\r\n if (parentMeasure.width < parentMeasure.height) {\r\n this._currentMeasure.height = parentMeasure.width;\r\n } else {\r\n this._currentMeasure.width = parentMeasure.height;\r\n }\r\n }\r\n\r\n private _updateSquareProps(): void {\r\n const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;\r\n const wheelThickness = radius * 0.2;\r\n const innerDiameter = (radius - wheelThickness) * 2;\r\n const squareSize = innerDiameter / Math.sqrt(2);\r\n const offset = radius - squareSize * 0.5;\r\n\r\n this._squareLeft = this._currentMeasure.left + offset;\r\n this._squareTop = this._currentMeasure.top + offset;\r\n this._squareSize = squareSize;\r\n }\r\n\r\n private _drawGradientSquare(hueValue: number, left: number, top: number, width: number, height: number, context: ICanvasRenderingContext) {\r\n const lgh = context.createLinearGradient(left, top, width + left, top);\r\n lgh.addColorStop(0, \"#fff\");\r\n lgh.addColorStop(1, \"hsl(\" + hueValue + \", 100%, 50%)\");\r\n\r\n context.fillStyle = lgh;\r\n context.fillRect(left, top, width, height);\r\n\r\n const lgv = context.createLinearGradient(left, top, left, height + top);\r\n lgv.addColorStop(0, \"rgba(0,0,0,0)\");\r\n lgv.addColorStop(1, \"#000\");\r\n\r\n context.fillStyle = lgv;\r\n context.fillRect(left, top, width, height);\r\n }\r\n\r\n private _drawCircle(centerX: number, centerY: number, radius: number, context: ICanvasRenderingContext) {\r\n context.beginPath();\r\n context.arc(centerX, centerY, radius + 1, 0, 2 * Math.PI, false);\r\n context.lineWidth = 3;\r\n context.strokeStyle = \"#333333\";\r\n context.stroke();\r\n context.beginPath();\r\n context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);\r\n context.lineWidth = 3;\r\n context.strokeStyle = \"#ffffff\";\r\n context.stroke();\r\n }\r\n\r\n private _createColorWheelCanvas(radius: number, thickness: number): ICanvas {\r\n // Shoudl abstract platform instead of using LastCreatedEngine\r\n const engine = EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n throw new Error(\"Invalid engine. Unable to create a canvas.\");\r\n }\r\n const canvas = engine.createCanvas(radius * 2, radius * 2);\r\n const context = canvas.getContext(\"2d\");\r\n const image = context.getImageData(0, 0, radius * 2, radius * 2);\r\n const data = image.data;\r\n\r\n const color = this._tmpColor;\r\n const maxDistSq = radius * radius;\r\n const innerRadius = radius - thickness;\r\n const minDistSq = innerRadius * innerRadius;\r\n\r\n for (let x = -radius; x < radius; x++) {\r\n for (let y = -radius; y < radius; y++) {\r\n const distSq = x * x + y * y;\r\n\r\n if (distSq > maxDistSq || distSq < minDistSq) {\r\n continue;\r\n }\r\n\r\n const dist = Math.sqrt(distSq);\r\n const ang = Math.atan2(y, x);\r\n\r\n Color3.HSVtoRGBToRef((ang * 180) / Math.PI + 180, dist / radius, 1, color);\r\n\r\n const index = (x + radius + (y + radius) * 2 * radius) * 4;\r\n\r\n data[index] = color.r * 255;\r\n data[index + 1] = color.g * 255;\r\n data[index + 2] = color.b * 255;\r\n let alphaRatio = (dist - innerRadius) / (radius - innerRadius);\r\n\r\n //apply less alpha to bigger color pickers\r\n let alphaAmount = 0.2;\r\n const maxAlpha = 0.2;\r\n const minAlpha = 0.04;\r\n const lowerRadius = 50;\r\n const upperRadius = 150;\r\n\r\n if (radius < lowerRadius) {\r\n alphaAmount = maxAlpha;\r\n } else if (radius > upperRadius) {\r\n alphaAmount = minAlpha;\r\n } else {\r\n alphaAmount = ((minAlpha - maxAlpha) * (radius - lowerRadius)) / (upperRadius - lowerRadius) + maxAlpha;\r\n }\r\n\r\n alphaRatio = (dist - innerRadius) / (radius - innerRadius);\r\n\r\n if (alphaRatio < alphaAmount) {\r\n data[index + 3] = 255 * (alphaRatio / alphaAmount);\r\n } else if (alphaRatio > 1 - alphaAmount) {\r\n data[index + 3] = 255 * (1.0 - (alphaRatio - (1 - alphaAmount)) / alphaAmount);\r\n } else {\r\n data[index + 3] = 255;\r\n }\r\n }\r\n }\r\n\r\n context.putImageData(image, 0, 0);\r\n\r\n return canvas;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _draw(context: ICanvasRenderingContext): void {\r\n context.save();\r\n\r\n this._applyStates(context);\r\n\r\n const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;\r\n const wheelThickness = radius * 0.2;\r\n const left = this._currentMeasure.left;\r\n const top = this._currentMeasure.top;\r\n\r\n if (!this._colorWheelCanvas || this._colorWheelCanvas.width != radius * 2) {\r\n this._colorWheelCanvas = this._createColorWheelCanvas(radius, wheelThickness);\r\n }\r\n\r\n this._updateSquareProps();\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n\r\n context.fillRect(this._squareLeft, this._squareTop, this._squareSize, this._squareSize);\r\n }\r\n\r\n context.drawImage(this._colorWheelCanvas, left, top);\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowBlur = 0;\r\n context.shadowOffsetX = 0;\r\n context.shadowOffsetY = 0;\r\n }\r\n\r\n this._drawGradientSquare(this._h, this._squareLeft, this._squareTop, this._squareSize, this._squareSize, context);\r\n\r\n let cx = this._squareLeft + this._squareSize * this._s;\r\n let cy = this._squareTop + this._squareSize * (1 - this._v);\r\n\r\n this._drawCircle(cx, cy, radius * 0.04, context);\r\n\r\n const dist = radius - wheelThickness * 0.5;\r\n cx = left + radius + Math.cos(((this._h - 180) * Math.PI) / 180) * dist;\r\n cy = top + radius + Math.sin(((this._h - 180) * Math.PI) / 180) * dist;\r\n this._drawCircle(cx, cy, wheelThickness * 0.35, context);\r\n\r\n context.restore();\r\n }\r\n\r\n // Events\r\n private _pointerIsDown = false;\r\n\r\n private _updateValueFromPointer(x: number, y: number): void {\r\n if (this._pointerStartedOnWheel) {\r\n const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;\r\n const centerX = radius + this._currentMeasure.left;\r\n const centerY = radius + this._currentMeasure.top;\r\n this._h = (Math.atan2(y - centerY, x - centerX) * 180) / Math.PI + 180;\r\n } else if (this._pointerStartedOnSquare) {\r\n this._updateSquareProps();\r\n this._s = (x - this._squareLeft) / this._squareSize;\r\n this._v = 1 - (y - this._squareTop) / this._squareSize;\r\n this._s = Math.min(this._s, 1);\r\n this._s = Math.max(this._s, ColorPicker._Epsilon);\r\n this._v = Math.min(this._v, 1);\r\n this._v = Math.max(this._v, ColorPicker._Epsilon);\r\n }\r\n\r\n Color3.HSVtoRGBToRef(this._h, this._s, this._v, this._tmpColor);\r\n\r\n this.value = this._tmpColor;\r\n }\r\n\r\n private _isPointOnSquare(x: number, y: number): boolean {\r\n this._updateSquareProps();\r\n\r\n const left = this._squareLeft;\r\n const top = this._squareTop;\r\n const size = this._squareSize;\r\n\r\n if (x >= left && x <= left + size && y >= top && y <= top + size) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private _isPointOnWheel(x: number, y: number): boolean {\r\n const radius = Math.min(this._currentMeasure.width, this._currentMeasure.height) * 0.5;\r\n const centerX = radius + this._currentMeasure.left;\r\n const centerY = radius + this._currentMeasure.top;\r\n const wheelThickness = radius * 0.2;\r\n const innerRadius = radius - wheelThickness;\r\n const radiusSq = radius * radius;\r\n const innerRadiusSq = innerRadius * innerRadius;\r\n\r\n const dx = x - centerX;\r\n const dy = y - centerY;\r\n\r\n const distSq = dx * dx + dy * dy;\r\n\r\n if (distSq <= radiusSq && distSq >= innerRadiusSq) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public override _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {\r\n return false;\r\n }\r\n\r\n if (this.isReadOnly) {\r\n return true;\r\n }\r\n\r\n this._pointerIsDown = true;\r\n\r\n this._pointerStartedOnSquare = false;\r\n this._pointerStartedOnWheel = false;\r\n\r\n // Invert transform\r\n this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition);\r\n\r\n const x = this._transformedPosition.x;\r\n const y = this._transformedPosition.y;\r\n\r\n if (this._isPointOnSquare(x, y)) {\r\n this._pointerStartedOnSquare = true;\r\n } else if (this._isPointOnWheel(x, y)) {\r\n this._pointerStartedOnWheel = true;\r\n }\r\n\r\n this._updateValueFromPointer(x, y);\r\n this._host._capturingControl[pointerId] = this;\r\n this._lastPointerDownId = pointerId;\r\n return true;\r\n }\r\n\r\n public override _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: PointerInfoBase): void {\r\n // Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)\r\n if (pointerId != this._lastPointerDownId) {\r\n return;\r\n }\r\n\r\n if (!this.isReadOnly) {\r\n // Invert transform\r\n this._invertTransformMatrix.transformCoordinates(coordinates.x, coordinates.y, this._transformedPosition);\r\n\r\n const x = this._transformedPosition.x;\r\n const y = this._transformedPosition.y;\r\n\r\n if (this._pointerIsDown) {\r\n this._updateValueFromPointer(x, y);\r\n }\r\n }\r\n\r\n super._onPointerMove(target, coordinates, pointerId, pi);\r\n }\r\n\r\n public override _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean, pi: PointerInfoBase): void {\r\n this._pointerIsDown = false;\r\n\r\n delete this._host._capturingControl[pointerId];\r\n super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi);\r\n }\r\n\r\n public override _onCanvasBlur() {\r\n this._forcePointerUp();\r\n super._onCanvasBlur();\r\n }\r\n\r\n /**\r\n * This function expands the color picker by creating a color picker dialog with manual\r\n * color value input and the ability to save colors into an array to be used later in\r\n * subsequent launches of the dialogue.\r\n * @param advancedTexture defines the AdvancedDynamicTexture the dialog is assigned to\r\n * @param options defines size for dialog and options for saved colors. Also accepts last color picked as hex string and saved colors array as hex strings.\r\n * @param options.pickerWidth\r\n * @param options.pickerHeight\r\n * @param options.headerHeight\r\n * @param options.lastColor\r\n * @param options.swatchLimit\r\n * @param options.numSwatchesPerLine\r\n * @param options.savedColors\r\n * @returns picked color as a hex string and the saved colors array as hex strings.\r\n */\r\n public static ShowPickerDialogAsync(\r\n advancedTexture: AdvancedDynamicTexture,\r\n options: {\r\n pickerWidth?: string;\r\n pickerHeight?: string;\r\n headerHeight?: string;\r\n lastColor?: string;\r\n swatchLimit?: number;\r\n numSwatchesPerLine?: number;\r\n savedColors?: Array<string>;\r\n }\r\n ): Promise<{\r\n savedColors?: string[];\r\n pickedColor: string;\r\n }> {\r\n return new Promise((resolve) => {\r\n // Default options\r\n options.pickerWidth = options.pickerWidth || \"640px\";\r\n options.pickerHeight = options.pickerHeight || \"400px\";\r\n options.headerHeight = options.headerHeight || \"35px\";\r\n options.lastColor = options.lastColor || \"#000000\";\r\n options.swatchLimit = options.swatchLimit || 20;\r\n options.numSwatchesPerLine = options.numSwatchesPerLine || 10;\r\n\r\n // Window size settings\r\n const drawerMaxRows: number = options.swatchLimit / options.numSwatchesPerLine;\r\n const rawSwatchSize: number = parseFloat(<string>options.pickerWidth) / options.numSwatchesPerLine;\r\n const gutterSize: number = Math.floor(rawSwatchSize * 0.25);\r\n const colGutters: number = gutterSize * (options.numSwatchesPerLine + 1);\r\n const swatchSize: number = Math.floor((parseFloat(<string>options.pickerWidth) - colGutters) / options.numSwatchesPerLine);\r\n const drawerMaxSize: number = swatchSize * drawerMaxRows + gutterSize * (drawerMaxRows + 1);\r\n const containerSize: string = (parseInt(options.pickerHeight) + drawerMaxSize + Math.floor(swatchSize * 0.25)).toString() + \"px\";\r\n\r\n // Button Colors\r\n const buttonColor: string = \"#c0c0c0\";\r\n const buttonBackgroundColor: string = \"#535353\";\r\n const buttonBackgroundHoverColor: string = \"#414141\";\r\n const buttonBackgroundClickColor: string = \"515151\";\r\n const buttonDisabledColor: string = \"#555555\";\r\n const buttonDisabledBackgroundColor: string = \"#454545\";\r\n const currentSwatchesOutlineColor: string = \"#404040\";\r\n const luminanceLimitColor: Color3 = Color3.FromHexString(\"#dddddd\");\r\n const luminanceLimit: number = luminanceLimitColor.r + luminanceLimitColor.g + luminanceLimitColor.b;\r\n const iconColorDark: string = \"#aaaaaa\";\r\n const iconColorLight: string = \"#ffffff\";\r\n\r\n // Button settings\r\n let buttonFontSize: number;\r\n let butEdit: Button;\r\n\r\n // Input Text Colors\r\n const inputFieldLabels: string[] = [\"R\", \"G\", \"B\"];\r\n const inputTextBackgroundColor: string = \"#454545\";\r\n const inputTextColor: string = \"#f0f0f0\";\r\n\r\n // This int is used for naming swatches and serves as the index for calling them from the list\r\n let swatchNumber: number;\r\n\r\n // Menu Panel options. We need to know if the swatchDrawer exists so we can create it if needed.\r\n let swatchDrawer: Grid;\r\n let editSwatchMode: boolean = false;\r\n\r\n // Color InputText fields that will be updated upon value change\r\n let butSave: Button;\r\n let lastVal: string;\r\n let activeField: string;\r\n\r\n // Dialog menu container which will contain both the main dialogue window and the swatch drawer which opens once a color is saved.\r\n const dialogContainer: Grid = new Grid();\r\n dialogContainer.name = \"Dialog Container\";\r\n dialogContainer.width = options.pickerWidth;\r\n if (options.savedColors) {\r\n dialogContainer.height = containerSize;\r\n const topRow: number = parseInt(options.pickerHeight) / parseInt(containerSize);\r\n dialogContainer.addRowDefinition(topRow, false);\r\n dialogContainer.addRowDefinition(1.0 - topRow, false);\r\n } else {\r\n dialogContainer.height = options.pickerHeight;\r\n dialogContainer.addRowDefinition(1.0, false);\r\n }\r\n advancedTexture.addControl(dialogContainer);\r\n\r\n // Swatch drawer which contains all saved color buttons\r\n if (options.savedColors) {\r\n swatchDrawer = new Grid();\r\n swatchDrawer.name = \"Swatch Drawer\";\r\n swatchDrawer.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n swatchDrawer.background = buttonBackgroundColor;\r\n swatchDrawer.width = options.pickerWidth!;\r\n const initialRows: number = options.savedColors.length / options.numSwatchesPerLine;\r\n let gutterCount: number;\r\n if (initialRows == 0) {\r\n gutterCount = 0;\r\n } else {\r\n gutterCount = initialRows + 1;\r\n }\r\n swatchDrawer.height = (swatchSize * initialRows + gutterCount * gutterSize).toString() + \"px\";\r\n swatchDrawer.top = Math.floor(swatchSize * 0.25).toString() + \"px\";\r\n for (let i = 0; i < Math.ceil(options.savedColors.length / options.numSwatchesPerLine) * 2 + 1; i++) {\r\n if (i % 2 != 0) {\r\n swatchDrawer.addRowDefinition(swatchSize, true);\r\n } else {\r\n swatchDrawer.addRowDefinition(gutterSize, true);\r\n }\r\n }\r\n for (let i = 0; i < options.numSwatchesPerLine! * 2 + 1; i++) {\r\n if (i % 2 != 0) {\r\n swatchDrawer.addColumnDefinition(swatchSize, true);\r\n } else {\r\n swatchDrawer.addColumnDefinition(gutterSize, true);\r\n }\r\n }\r\n dialogContainer.addControl(swatchDrawer, 1, 0);\r\n }\r\n\r\n // Picker container\r\n const pickerPanel: Grid = new Grid();\r\n pickerPanel.name = \"Picker Panel\";\r\n pickerPanel.height = options.pickerHeight;\r\n const panelHead: number = parseInt(options.headerHeight) / parseInt(options.pickerHeight);\r\n const pickerPanelRows: number[] = [panelHead, 1.0 - panelHead];\r\n pickerPanel.addRowDefinition(pickerPanelRows[0], false);\r\n pickerPanel.addRowDefinition(pickerPanelRows[1], false);\r\n dialogContainer.addControl(pickerPanel, 0, 0);\r\n\r\n // Picker container header\r\n const header: Rectangle = new Rectangle();\r\n header.name = \"Dialogue Header Bar\";\r\n header.background = \"#cccccc\";\r\n header.thickness = 0;\r\n pickerPanel.addControl(header, 0, 0);\r\n\r\n // Header close button\r\n const closeButton: Button = Button.CreateSimpleButton(\"closeButton\", \"a\");\r\n closeButton.fontFamily = \"coreglyphs\";\r\n const headerColor3: Color3 = Color3.FromHexString(header.background);\r\n const closeIconColor = new Color3(1.0 - headerColor3.r, 1.0 - headerColor3.g, 1.0 - headerColor3.b);\r\n closeButton.color = closeIconColor.toHexString();\r\n closeButton.fontSize = Math.floor(parseInt(options.headerHeight!) * 0.6);\r\n closeButton.textBlock!.textVerticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n closeButton.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_RIGHT;\r\n closeButton.height = closeButton.width = options.headerHeight;\r\n closeButton.background = header.background;\r\n closeButton.thickness = 0;\r\n closeButton.pointerDownAnimation = () => {};\r\n closeButton.pointerUpAnimation = () => {\r\n closeButton.background = header.background;\r\n };\r\n closeButton.pointerEnterAnimation = () => {\r\n closeButton.color = header.background;\r\n closeButton.background = \"red\";\r\n };\r\n closeButton.pointerOutAnimation = () => {\r\n closeButton.color = closeIconColor.toHexString();\r\n closeButton.background = header.background;\r\n };\r\n closeButton.onPointerClickObservable.add(() => {\r\n closePicker(currentSwatch.background);\r\n });\r\n pickerPanel.addControl(closeButton, 0, 0);\r\n\r\n // Dialog container body\r\n const dialogBody: Grid = new Grid();\r\n dialogBody.name = \"Dialogue Body\";\r\n dialogBody.background = buttonBackgroundColor;\r\n const dialogBodyCols: number[] = [0.4375, 0.5625];\r\n dialogBody.addRowDefinition(1.0, false);\r\n dialogBody.addColumnDefinition(dialogBodyCols[0], false);\r\n dialogBody.addColumnDefinition(dialogBodyCols[1], false);\r\n pickerPanel.addControl(dialogBody, 1, 0);\r\n\r\n // Picker grid\r\n const pickerGrid: Grid = new Grid();\r\n pickerGrid.name = \"Picker Grid\";\r\n pickerGrid.addRowDefinition(0.85, false);\r\n pickerGrid.addRowDefinition(0.15, false);\r\n dialogBody.addControl(pickerGrid, 0, 0);\r\n\r\n // Picker control\r\n const picker = new ColorPicker();\r\n picker.name = \"GUI Color Picker\";\r\n if (options.pickerHeight < options.pickerWidth) {\r\n picker.width = 0.89;\r\n } else {\r\n picker.height = 0.89;\r\n }\r\n picker.value = Color3.FromHexString(options.lastColor);\r\n picker.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n picker.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n picker.onPointerDownObservable.add(() => {\r\n activeField = picker.name!;\r\n lastVal = \"\";\r\n editSwatches(false);\r\n });\r\n picker.onValueChangedObservable.add(function (value) {\r\n // value is a color3\r\n if (activeField == picker.name) {\r\n updateValues(value, picker.name);\r\n }\r\n });\r\n pickerGrid.addControl(picker, 0, 0);\r\n\r\n // Picker body right quarant\r\n const pickerBodyRight: Grid = new Grid();\r\n pickerBodyRight.name = \"Dialogue Right Half\";\r\n pickerBodyRight.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n const pickerBodyRightRows: number[] = [0.514, 0.486];\r\n pickerBodyRight.addRowDefinition(pickerBodyRightRows[0], false);\r\n pickerBodyRight.addRowDefinition(pickerBodyRightRows[1], false);\r\n dialogBody.addControl(pickerBodyRight, 1, 1);\r\n\r\n // Picker container swatches and buttons\r\n const pickerSwatchesButtons: Grid = new Grid();\r\n pickerSwatchesButtons.name = \"Swatches and Buttons\";\r\n const pickerButtonsCol: number[] = [0.417, 0.583];\r\n pickerSwatchesButtons.addRowDefinition(1.0, false);\r\n pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[0], false);\r\n pickerSwatchesButtons.addColumnDefinition(pickerButtonsCol[1], false);\r\n pickerBodyRight.addControl(pickerSwatchesButtons, 0, 0);\r\n\r\n // Picker Swatches quadrant\r\n const pickerSwatches: Grid = new Grid();\r\n pickerSwatches.name = \"New and Current Swatches\";\r\n const pickeSwatchesRows: number[] = [0.04, 0.16, 0.64, 0.16];\r\n pickerSwatches.addRowDefinition(pickeSwatchesRows[0], false);\r\n pickerSwatches.addRowDefinition(pickeSwatchesRows[1], false);\r\n pickerSwatches.addRowDefinition(pickeSwatchesRows[2], false);\r\n pickerSwatches.addRowDefinition(pickeSwatchesRows[3], false);\r\n pickerSwatchesButtons.addControl(pickerSwatches, 0, 0);\r\n\r\n // Active swatches\r\n const activeSwatches: Grid = new Grid();\r\n activeSwatches.name = \"Active Swatches\";\r\n activeSwatches.width = 0.67;\r\n activeSwatches.addRowDefinition(0.5, false);\r\n activeSwatches.addRowDefinition(0.5, false);\r\n pickerSwatches.addControl(activeSwatches, 2, 0);\r\n\r\n const labelWidth: number = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[0] * 0.11);\r\n const labelHeight: number = Math.floor(parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * pickeSwatchesRows[1] * 0.5);\r\n\r\n let labelTextSize: number;\r\n if (options.pickerWidth > options.pickerHeight) {\r\n labelTextSize = labelHeight;\r\n } else {\r\n labelTextSize = labelWidth;\r\n }\r\n // New color swatch and previous color button\r\n const newText: TextBlock = new TextBlock();\r\n newText.text = \"new\";\r\n newText.name = \"New Color Label\";\r\n newText.color = buttonColor;\r\n newText.fontSize = labelTextSize;\r\n pickerSwatches.addControl(newText, 1, 0);\r\n\r\n const newSwatch = new Rectangle();\r\n newSwatch.name = \"New Color Swatch\";\r\n newSwatch.background = options.lastColor;\r\n newSwatch.thickness = 0;\r\n activeSwatches.addControl(newSwatch, 0, 0);\r\n\r\n const currentSwatch: Button = Button.CreateSimpleButton(\"currentSwatch\", \"\");\r\n currentSwatch.background = options.lastColor;\r\n currentSwatch.thickness = 0;\r\n currentSwatch.onPointerClickObservable.add(() => {\r\n const revertColor = Color3.FromHexString(currentSwatch.background);\r\n updateValues(revertColor, currentSwatch.name!);\r\n editSwatches(false);\r\n });\r\n currentSwatch.pointerDownAnimation = () => {};\r\n currentSwatch.pointerUpAnimation = () => {};\r\n currentSwatch.pointerEnterAnimation = () => {};\r\n currentSwatch.pointerOutAnimation = () => {};\r\n activeSwatches.addControl(currentSwatch, 1, 0);\r\n\r\n const swatchOutline: Rectangle = new Rectangle();\r\n swatchOutline.name = \"Swatch Outline\";\r\n swatchOutline.width = 0.67;\r\n swatchOutline.thickness = 2;\r\n swatchOutline.color = currentSwatchesOutlineColor;\r\n swatchOutline.isHitTestVisible = false;\r\n pickerSwatches.addControl(swatchOutline, 2, 0);\r\n\r\n const currentText: TextBlock = new TextBlock();\r\n currentText.name = \"Current Color Label\";\r\n currentText.text = \"current\";\r\n currentText.color = buttonColor;\r\n currentText.fontSize = labelTextSize;\r\n pickerSwatches.addControl(currentText, 3, 0);\r\n\r\n // Buttons grid\r\n const buttonGrid: Grid = new Grid();\r\n buttonGrid.name = \"Button Grid\";\r\n buttonGrid.height = 0.8;\r\n const buttonGridRows: number = 1 / 3;\r\n buttonGrid.addRowDefinition(buttonGridRows, false);\r\n buttonGrid.addRowDefinition(buttonGridRows, false);\r\n buttonGrid.addRowDefinition(buttonGridRows, false);\r\n pickerSwatchesButtons.addControl(buttonGrid, 0, 1);\r\n\r\n // Determine pixel width and height for all buttons from overall panel dimensions\r\n const buttonWidth = Math.floor(parseInt(options.pickerWidth) * dialogBodyCols[1] * pickerButtonsCol[1] * 0.67).toString() + \"px\";\r\n const buttonHeight =\r\n Math.floor(\r\n parseInt(options.pickerHeight) * pickerPanelRows[1] * pickerBodyRightRows[0] * (parseFloat(buttonGrid.height.toString()) / 100) * buttonGridRows * 0.7\r\n ).toString() + \"px\";\r\n\r\n // Determine button type size\r\n if (parseFloat(buttonWidth) > parseFloat(buttonHeight)) {\r\n buttonFontSize = Math.floor(parseFloat(buttonHeight) * 0.45);\r\n } else {\r\n buttonFontSize = Math.floor(parseFloat(buttonWidth) * 0.11);\r\n }\r\n\r\n // Panel Buttons\r\n const butOK: Button = Button.CreateSimpleButton(\"butOK\", \"OK\");\r\n butOK.width = buttonWidth;\r\n butOK.height = buttonHeight;\r\n butOK.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n butOK.thickness = 2;\r\n butOK.color = buttonColor;\r\n butOK.fontSize = buttonFontSize;\r\n butOK.background = buttonBackgroundColor;\r\n butOK.onPointerEnterObservable.add(() => {\r\n butOK.background = buttonBackgroundHoverColor;\r\n });\r\n butOK.onPointerOutObservable.add(() => {\r\n butOK.background = buttonBackgroundColor;\r\n });\r\n butOK.pointerDownAnimation = () => {\r\n butOK.background = buttonBackgroundClickColor;\r\n };\r\n butOK.pointerUpAnimation = () => {\r\n butOK.background = buttonBackgroundHoverColor;\r\n };\r\n butOK.onPointerClickObservable.add(() => {\r\n editSwatches(false);\r\n closePicker(newSwatch.background);\r\n });\r\n buttonGrid.addControl(butOK, 0, 0);\r\n\r\n const butCancel: Button = Button.CreateSimpleButton(\"butCancel\", \"Cancel\");\r\n butCancel.width = buttonWidth;\r\n butCancel.height = buttonHeight;\r\n butCancel.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n butCancel.thickness = 2;\r\n butCancel.color = buttonColor;\r\n butCancel.fontSize = buttonFontSize;\r\n butCancel.background = buttonBackgroundColor;\r\n butCancel.onPointerEnterObservable.add(() => {\r\n butCancel.background = buttonBackgroundHoverColor;\r\n });\r\n butCancel.onPointerOutObservable.add(() => {\r\n butCancel.background = buttonBackgroundColor;\r\n });\r\n butCancel.pointerDownAnimation = () => {\r\n butCancel.background = buttonBackgroundClickColor;\r\n };\r\n butCancel.pointerUpAnimation = () => {\r\n butCancel.background = buttonBackgroundHoverColor;\r\n };\r\n butCancel.onPointerClickObservable.add(() => {\r\n editSwatches(false);\r\n closePicker(currentSwatch.background);\r\n });\r\n buttonGrid.addControl(butCancel, 1, 0);\r\n\r\n if (options.savedColors) {\r\n butSave = Button.CreateSimpleButton(\"butSave\", \"Save\");\r\n butSave.width = buttonWidth;\r\n butSave.height = buttonHeight;\r\n butSave.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n butSave.thickness = 2;\r\n butSave.fontSize = buttonFontSize;\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n butSave.color = buttonColor;\r\n butSave.background = buttonBackgroundColor;\r\n } else {\r\n disableButton(butSave, true);\r\n }\r\n butSave.onPointerEnterObservable.add(() => {\r\n if (options.savedColors) {\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n butSave.background = buttonBackgroundHoverColor;\r\n }\r\n }\r\n });\r\n butSave.onPointerOutObservable.add(() => {\r\n if (options.savedColors) {\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n butSave.background = buttonBackgroundColor;\r\n }\r\n }\r\n });\r\n butSave.pointerDownAnimation = () => {\r\n if (options.savedColors) {\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n butSave.background = buttonBackgroundClickColor;\r\n }\r\n }\r\n };\r\n butSave.pointerUpAnimation = () => {\r\n if (options.savedColors) {\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n butSave.background = buttonBackgroundHoverColor;\r\n }\r\n }\r\n };\r\n butSave.onPointerClickObservable.add(() => {\r\n if (options.savedColors) {\r\n if (options.savedColors.length == 0) {\r\n setEditButtonVisibility(true);\r\n }\r\n if (options.savedColors.length < options.swatchLimit!) {\r\n updateSwatches(newSwatch.background, butSave);\r\n }\r\n editSwatches(false);\r\n }\r\n });\r\n if (options.savedColors.length > 0) {\r\n setEditButtonVisibility(true);\r\n }\r\n buttonGrid.addControl(butSave, 2, 0);\r\n }\r\n\r\n // Picker color values input\r\n const pickerColorValues: Grid = new Grid();\r\n pickerColorValues.name = \"Dialog Lower Right\";\r\n pickerColorValues.addRowDefinition(0.02, false);\r\n pickerColorValues.addRowDefinition(0.63, false);\r\n pickerColorValues.addRowDefinition(0.21, false);\r\n pickerColorValues.addRowDefinition(0.14, false);\r\n pickerBodyRight.addControl(pickerColorValues, 1, 0);\r\n\r\n // RGB values text boxes\r\n const currentColor = Color3.FromHexString(options.lastColor);\r\n const rgbValuesQuadrant: Grid = new Grid();\r\n rgbValuesQuadrant.name = \"RGB Values\";\r\n rgbValuesQuadrant.width = 0.82;\r\n rgbValuesQuadrant.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n rgbValuesQuadrant.addRowDefinition(1 / 3, false);\r\n rgbValuesQuadrant.addRowDefinition(1 / 3, false);\r\n rgbValuesQuadrant.addRowDefinition(1 / 3, false);\r\n rgbValuesQuadrant.addColumnDefinition(0.1, false);\r\n rgbValuesQuadrant.addColumnDefinition(0.2, false);\r\n rgbValuesQuadrant.addColumnDefinition(0.7, false);\r\n pickerColorValues.addControl(rgbValuesQuadrant, 1, 0);\r\n\r\n for (let i = 0; i < inputFieldLabels.length; i++) {\r\n const labelText: TextBlock = new TextBlock();\r\n labelText.text = inputFieldLabels[i];\r\n labelText.color = buttonColor;\r\n labelText.fontSize = buttonFontSize;\r\n rgbValuesQuadrant.addControl(labelText, i, 0);\r\n }\r\n\r\n // Input fields for RGB values\r\n const rValInt = new InputText();\r\n rValInt.width = 0.83;\r\n rValInt.height = 0.72;\r\n rValInt.name = \"rIntField\";\r\n rValInt.fontSize = buttonFontSize;\r\n rValInt.text = (currentColor.r * 255).toString();\r\n rValInt.color = inputTextColor;\r\n rValInt.background = inputTextBackgroundColor;\r\n rValInt.onFocusObservable.add(() => {\r\n activeField = rValInt.name!;\r\n lastVal = rValInt.text;\r\n editSwatches(false);\r\n });\r\n rValInt.onBlurObservable.add(() => {\r\n if (rValInt.text == \"\") {\r\n rValInt.text = \"0\";\r\n }\r\n updateInt(rValInt, \"r\");\r\n if (activeField == rValInt.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n rValInt.onTextChangedObservable.add(() => {\r\n if (activeField == rValInt.name) {\r\n updateInt(rValInt, \"r\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(rValInt, 0, 1);\r\n\r\n const gValInt = new InputText();\r\n gValInt.width = 0.83;\r\n gValInt.height = 0.72;\r\n gValInt.name = \"gIntField\";\r\n gValInt.fontSize = buttonFontSize;\r\n gValInt.text = (currentColor.g * 255).toString();\r\n gValInt.color = inputTextColor;\r\n gValInt.background = inputTextBackgroundColor;\r\n gValInt.onFocusObservable.add(() => {\r\n activeField = gValInt.name!;\r\n lastVal = gValInt.text;\r\n editSwatches(false);\r\n });\r\n gValInt.onBlurObservable.add(() => {\r\n if (gValInt.text == \"\") {\r\n gValInt.text = \"0\";\r\n }\r\n updateInt(gValInt, \"g\");\r\n if (activeField == gValInt.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n gValInt.onTextChangedObservable.add(() => {\r\n if (activeField == gValInt.name) {\r\n updateInt(gValInt, \"g\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(gValInt, 1, 1);\r\n\r\n const bValInt = new InputText();\r\n bValInt.width = 0.83;\r\n bValInt.height = 0.72;\r\n bValInt.name = \"bIntField\";\r\n bValInt.fontSize = buttonFontSize;\r\n bValInt.text = (currentColor.b * 255).toString();\r\n bValInt.color = inputTextColor;\r\n bValInt.background = inputTextBackgroundColor;\r\n bValInt.onFocusObservable.add(() => {\r\n activeField = bValInt.name!;\r\n lastVal = bValInt.text;\r\n editSwatches(false);\r\n });\r\n bValInt.onBlurObservable.add(() => {\r\n if (bValInt.text == \"\") {\r\n bValInt.text = \"0\";\r\n }\r\n updateInt(bValInt, \"b\");\r\n if (activeField == bValInt.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n bValInt.onTextChangedObservable.add(() => {\r\n if (activeField == bValInt.name) {\r\n updateInt(bValInt, \"b\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(bValInt, 2, 1);\r\n\r\n const rValDec = new InputText();\r\n rValDec.width = 0.95;\r\n rValDec.height = 0.72;\r\n rValDec.name = \"rDecField\";\r\n rValDec.fontSize = buttonFontSize;\r\n rValDec.text = currentColor.r.toString();\r\n rValDec.color = inputTextColor;\r\n rValDec.background = inputTextBackgroundColor;\r\n rValDec.onFocusObservable.add(() => {\r\n activeField = rValDec.name!;\r\n lastVal = rValDec.text;\r\n editSwatches(false);\r\n });\r\n rValDec.onBlurObservable.add(() => {\r\n if (parseFloat(rValDec.text) == 0 || rValDec.text == \"\") {\r\n rValDec.text = \"0\";\r\n updateFloat(rValDec, \"r\");\r\n }\r\n if (activeField == rValDec.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n rValDec.onTextChangedObservable.add(() => {\r\n if (activeField == rValDec.name) {\r\n updateFloat(rValDec, \"r\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(rValDec, 0, 2);\r\n\r\n const gValDec = new InputText();\r\n gValDec.width = 0.95;\r\n gValDec.height = 0.72;\r\n gValDec.name = \"gDecField\";\r\n gValDec.fontSize = buttonFontSize;\r\n gValDec.text = currentColor.g.toString();\r\n gValDec.color = inputTextColor;\r\n gValDec.background = inputTextBackgroundColor;\r\n gValDec.onFocusObservable.add(() => {\r\n activeField = gValDec.name!;\r\n lastVal = gValDec.text;\r\n editSwatches(false);\r\n });\r\n gValDec.onBlurObservable.add(() => {\r\n if (parseFloat(gValDec.text) == 0 || gValDec.text == \"\") {\r\n gValDec.text = \"0\";\r\n updateFloat(gValDec, \"g\");\r\n }\r\n if (activeField == gValDec.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n gValDec.onTextChangedObservable.add(() => {\r\n if (activeField == gValDec.name) {\r\n updateFloat(gValDec, \"g\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(gValDec, 1, 2);\r\n\r\n const bValDec = new InputText();\r\n bValDec.width = 0.95;\r\n bValDec.height = 0.72;\r\n bValDec.name = \"bDecField\";\r\n bValDec.fontSize = buttonFontSize;\r\n bValDec.text = currentColor.b.toString();\r\n bValDec.color = inputTextColor;\r\n bValDec.background = inputTextBackgroundColor;\r\n bValDec.onFocusObservable.add(() => {\r\n activeField = bValDec.name!;\r\n lastVal = bValDec.text;\r\n editSwatches(false);\r\n });\r\n bValDec.onBlurObservable.add(() => {\r\n if (parseFloat(bValDec.text) == 0 || bValDec.text == \"\") {\r\n bValDec.text = \"0\";\r\n updateFloat(bValDec, \"b\");\r\n }\r\n if (activeField == bValDec.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n bValDec.onTextChangedObservable.add(() => {\r\n if (activeField == bValDec.name) {\r\n updateFloat(bValDec, \"b\");\r\n }\r\n });\r\n rgbValuesQuadrant.addControl(bValDec, 2, 2);\r\n\r\n // Hex value input\r\n const hexValueQuadrant: Grid = new Grid();\r\n hexValueQuadrant.name = \"Hex Value\";\r\n hexValueQuadrant.width = 0.82;\r\n hexValueQuadrant.addRowDefinition(1.0, false);\r\n hexValueQuadrant.addColumnDefinition(0.1, false);\r\n hexValueQuadrant.addColumnDefinition(0.9, false);\r\n pickerColorValues.addControl(hexValueQuadrant, 2, 0);\r\n\r\n const labelText: TextBlock = new TextBlock();\r\n labelText.text = \"#\";\r\n labelText.color = buttonColor;\r\n labelText.fontSize = buttonFontSize;\r\n hexValueQuadrant.addControl(labelText, 0, 0);\r\n\r\n const hexVal = new InputText();\r\n hexVal.width = 0.96;\r\n hexVal.height = 0.72;\r\n hexVal.name = \"hexField\";\r\n hexVal.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n hexVal.fontSize = buttonFontSize;\r\n const minusPound = options.lastColor.split(\"#\");\r\n hexVal.text = minusPound[1];\r\n hexVal.color = inputTextColor;\r\n hexVal.background = inputTextBackgroundColor;\r\n hexVal.onFocusObservable.add(() => {\r\n activeField = hexVal.name!;\r\n lastVal = hexVal.text;\r\n editSwatches(false);\r\n });\r\n hexVal.onBlurObservable.add(() => {\r\n if (hexVal.text.length == 3) {\r\n const val = hexVal.text.split(\"\");\r\n hexVal.text = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];\r\n }\r\n if (hexVal.text == \"\") {\r\n hexVal.text = \"000000\";\r\n updateValues(Color3.FromHexString(hexVal.text), \"b\");\r\n }\r\n if (activeField == hexVal.name) {\r\n activeField = \"\";\r\n }\r\n });\r\n hexVal.onTextChangedObservable.add(() => {\r\n let newHexValue: string = hexVal.text;\r\n const checkHex: boolean = /[^0-9A-F]/i.test(newHexValue);\r\n if ((hexVal.text.length > 6 || checkHex) && activeField == hexVal.name) {\r\n hexVal.text = lastVal;\r\n } else {\r\n if (hexVal.text.length < 6) {\r\n const leadingZero: number = 6 - hexVal.text.length;\r\n for (let i = 0; i < leadingZero; i++) {\r\n newHexValue = \"0\" + newHexValue;\r\n }\r\n }\r\n if (hexVal.text.length == 3) {\r\n const val: string[] = hexVal.text.split(\"\");\r\n newHexValue = val[0] + val[0] + val[1] + val[1] + val[2] + val[2];\r\n }\r\n newHexValue = \"#\" + newHexValue;\r\n if (activeField == hexVal.name) {\r\n lastVal = hexVal.text;\r\n updateValues(Color3.FromHexString(newHexValue), hexVal.name);\r\n }\r\n }\r\n });\r\n hexValueQuadrant.addControl(hexVal, 0, 1);\r\n\r\n if (options.savedColors && options.savedColors.length > 0) {\r\n updateSwatches(\"\", butSave!);\r\n }\r\n\r\n /**\r\n * Will update all values for InputText and ColorPicker controls based on the BABYLON.Color3 passed to this function.\r\n * Each InputText control and the ColorPicker control will be tested to see if they are the activeField and if they\r\n * are will receive no update. This is to prevent the input from the user being overwritten.\r\n * @param value\r\n * @param inputField\r\n */\r\n function updateValues(value: Color3, inputField: string) {\r\n activeField = inputField;\r\n const pickedColor: string = value.toHexString();\r\n newSwatch.background = pickedColor;\r\n if (rValInt.name != activeField) {\r\n rValInt.text = Math.floor(value.r * 255).toString();\r\n }\r\n if (gValInt.name != activeField) {\r\n gValInt.text = Math.floor(value.g * 255).toString();\r\n }\r\n if (bValInt.name != activeField) {\r\n bValInt.text = Math.floor(value.b * 255).toString();\r\n }\r\n if (rValDec.name != activeField) {\r\n rValDec.text = value.r.toString();\r\n }\r\n if (gValDec.name != activeField) {\r\n gValDec.text = value.g.toString();\r\n }\r\n if (bValDec.name != activeField) {\r\n bValDec.text = value.b.toString();\r\n }\r\n if (hexVal.name != activeField) {\r\n const minusPound: string[] = pickedColor.split(\"#\");\r\n hexVal.text = minusPound[1];\r\n }\r\n if (picker.name != activeField) {\r\n picker.value = value;\r\n }\r\n }\r\n\r\n // When the user enters an integer for R, G, or B we check to make sure it is a valid number and replace if not.\r\n function updateInt(field: InputText, channel: string) {\r\n let newValue: string = field.text;\r\n const checkVal: boolean = /[^0-9]/g.test(newValue);\r\n if (checkVal) {\r\n field.text = lastVal;\r\n return;\r\n } else {\r\n if (newValue != \"\") {\r\n if (Math.floor(parseInt(newValue)) < 0) {\r\n newValue = \"0\";\r\n } else if (Math.floor(parseInt(newValue)) > 255) {\r\n newValue = \"255\";\r\n } else if (isNaN(parseInt(newValue))) {\r\n newValue = \"0\";\r\n }\r\n }\r\n if (activeField == field.name) {\r\n lastVal = newValue;\r\n }\r\n }\r\n if (newValue != \"\") {\r\n newValue = parseInt(newValue).toString();\r\n field.text = newValue;\r\n const newSwatchRGB: Color3 = Color3.FromHexString(newSwatch.background);\r\n if (activeField == field.name) {\r\n if (channel == \"r\") {\r\n updateValues(new Color3(parseInt(newValue) / 255, newSwatchRGB.g, newSwatchRGB.b), field.name);\r\n } else if (channel == \"g\") {\r\n updateValues(new Color3(newSwatchRGB.r, parseInt(newValue) / 255, newSwatchRGB.b), field.name);\r\n } else {\r\n updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, parseInt(newValue) / 255), field.name);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // When the user enters a float for R, G, or B we check to make sure it is a valid number and replace if not.\r\n function updateFloat(field: InputText, channel: string) {\r\n let newValue: string = field.text;\r\n const checkVal: boolean = /[^0-9.]/g.test(newValue);\r\n if (checkVal) {\r\n field.text = lastVal;\r\n return;\r\n } else {\r\n if (newValue != \"\" && newValue != \".\" && parseFloat(newValue) != 0) {\r\n if (parseFloat(newValue) < 0.0) {\r\n newValue = \"0.0\";\r\n } else if (parseFloat(newValue) > 1.0) {\r\n newValue = \"1.0\";\r\n } else if (isNaN(parseFloat(newValue))) {\r\n newValue = \"0.0\";\r\n }\r\n }\r\n if (activeField == field.name) {\r\n lastVal = newValue;\r\n }\r\n }\r\n if (newValue != \"\" && newValue != \".\" && parseFloat(newValue) != 0) {\r\n newValue = parseFloat(newValue).toString();\r\n field.text = newValue;\r\n } else {\r\n newValue = \"0.0\";\r\n }\r\n const newSwatchRGB = Color3.FromHexString(newSwatch.background);\r\n if (activeField == field.name) {\r\n if (channel == \"r\") {\r\n updateValues(new Color3(parseFloat(newValue), newSwatchRGB.g, newSwatchRGB.b), field.name);\r\n } else if (channel == \"g\") {\r\n updateValues(new Color3(newSwatchRGB.r, parseFloat(newValue), newSwatchRGB.b), field.name);\r\n } else {\r\n updateValues(new Color3(newSwatchRGB.r, newSwatchRGB.g, parseFloat(newValue)), field.name);\r\n }\r\n }\r\n }\r\n\r\n // Removes the current index from the savedColors array. Drawer can then be regenerated.\r\n function deleteSwatch(index: number) {\r\n if (options.savedColors) {\r\n options.savedColors.splice(index, 1);\r\n }\r\n if (options.savedColors && options.savedColors.length == 0) {\r\n setEditButtonVisibility(false);\r\n editSwatchMode = false;\r\n }\r\n }\r\n\r\n // Creates and styles an individual swatch when updateSwatches is called.\r\n function createSwatch() {\r\n if (options.savedColors && options.savedColors[swatchNumber]) {\r\n let icon: string;\r\n if (editSwatchMode) {\r\n icon = \"b\";\r\n } else {\r\n icon = \"\";\r\n }\r\n const swatch: Button = Button.CreateSimpleButton(\"Swatch_\" + swatchNumber, icon);\r\n swatch.fontFamily = \"coreglyphs\";\r\n const swatchColor: Color3 = Color3.FromHexString(options.savedColors[swatchNumber]);\r\n const swatchLuminence: number = swatchColor.r + swatchColor.g + swatchColor.b;\r\n\r\n // Set color of outline and textBlock based on luminance of the color swatch so feedback always visible\r\n if (swatchLuminence > luminanceLimit) {\r\n swatch.color = iconColorDark;\r\n } else {\r\n swatch.color = iconColorLight;\r\n }\r\n swatch.fontSize = Math.floor(swatchSize * 0.7);\r\n swatch.textBlock!.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n swatch.height = swatch.width = swatchSize.toString() + \"px\";\r\n swatch.background = options.savedColors[swatchNumber];\r\n swatch.thickness = 2;\r\n const metadata = swatchNumber;\r\n swatch.pointerDownAnimation = () => {\r\n swatch.thickness = 4;\r\n };\r\n swatch.pointerUpAnimation = () => {\r\n swatch.thickness = 3;\r\n };\r\n swatch.pointerEnterAnimation = () => {\r\n swatch.thickness = 3;\r\n };\r\n swatch.pointerOutAnimation = () => {\r\n swatch.thickness = 2;\r\n };\r\n swatch.onPointerClickObservable.add(() => {\r\n if (!editSwatchMode) {\r\n if (options.savedColors) {\r\n updateValues(Color3.FromHexString(options.savedColors[metadata]), swatch.name!);\r\n }\r\n } else {\r\n deleteSwatch(metadata);\r\n updateSwatches(\"\", butSave);\r\n }\r\n });\r\n return swatch;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n // Mode switch to render button text and close symbols on swatch controls\r\n function editSwatches(mode?: boolean) {\r\n if (mode !== undefined) {\r\n editSwatchMode = mode;\r\n }\r\n let thisButton: Button;\r\n if (editSwatchMode) {\r\n for (let i = 0; i < swatchDrawer.children.length; i++) {\r\n thisButton = swatchDrawer.children[i] as Button;\r\n thisButton.textBlock!.text = \"b\";\r\n }\r\n if (butEdit !== undefined) {\r\n butEdit.textBlock!.text = \"Done\";\r\n }\r\n } else {\r\n for (let i = 0; i < swatchDrawer.children.length; i++) {\r\n thisButton = swatchDrawer.children[i] as Button;\r\n thisButton.textBlock!.text = \"\";\r\n }\r\n if (butEdit !== undefined) {\r\n butEdit.textBlock!.text = \"Edit\";\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * When Save Color button is pressed this function will first create a swatch drawer if one is not already\r\n * made. Then all controls are removed from the drawer and we step through the savedColors array and\r\n * creates one swatch per color. It will also set the height of the drawer control based on how many\r\n * saved colors there are and how many can be stored per row.\r\n * @param color\r\n * @param button\r\n */\r\n function updateSwatches(color: string, button: Button) {\r\n if (options.savedColors) {\r\n if (color != \"\") {\r\n options.savedColors.push(color);\r\n }\r\n swatchNumber = 0;\r\n swatchDrawer.clearControls();\r\n const rowCount: number = Math.ceil(options.savedColors.length / options.numSwatchesPerLine!);\r\n let gutterCount: number;\r\n if (rowCount == 0) {\r\n gutterCount = 0;\r\n } else {\r\n gutterCount = rowCount + 1;\r\n }\r\n if (swatchDrawer.rowCount != rowCount + gutterCount) {\r\n const currentRows: number = swatchDrawer.rowCount;\r\n for (let i = 0; i < currentRows; i++) {\r\n swatchDrawer.removeRowDefinition(0);\r\n }\r\n for (let i = 0; i < rowCount + gutterCount; i++) {\r\n if (i % 2) {\r\n swatchDrawer.addRowDefinition(swatchSize, true);\r\n } else {\r\n swatchDrawer.addRowDefinition(gutterSize, true);\r\n }\r\n }\r\n }\r\n swatchDrawer.height = (swatchSize * rowCount + gutterCount * gutterSize).toString() + \"px\";\r\n\r\n for (let y = 1, thisRow = 1; y < rowCount + gutterCount; y += 2, thisRow++) {\r\n // Determine number of buttons to create per row based on the button limit per row and number of saved colors\r\n let totalButtonsThisRow: number;\r\n if (options.savedColors.length > thisRow * options.numSwatchesPerLine!) {\r\n totalButtonsThisRow = options.numSwatchesPerLine!;\r\n } else {\r\n totalButtonsThisRow = options.savedColors.length - (thisRow - 1) * options.numSwatchesPerLine!;\r\n }\r\n const buttonIterations: number = Math.min(Math.max(totalButtonsThisRow, 0), options.numSwatchesPerLine!);\r\n for (let x = 0, w = 1; x < buttonIterations; x++) {\r\n if (x > options.numSwatchesPerLine!) {\r\n continue;\r\n }\r\n const swatch: Button | null = createSwatch();\r\n if (swatch != null) {\r\n swatchDrawer.addControl(swatch, y, w);\r\n w += 2;\r\n swatchNumber++;\r\n } else {\r\n continue;\r\n }\r\n }\r\n }\r\n if (options.savedColors.length >= options.swatchLimit!) {\r\n disableButton(button, true);\r\n } else {\r\n disableButton(button, false);\r\n }\r\n }\r\n }\r\n\r\n // Shows or hides edit swatches button depending on if there are saved swatches\r\n function setEditButtonVisibility(enableButton: boolean) {\r\n if (enableButton) {\r\n butEdit = Button.CreateSimpleButton(\"butEdit\", \"Edit\");\r\n butEdit.width = buttonWidth;\r\n butEdit.height = buttonHeight;\r\n butEdit.left = Math.floor(parseInt(buttonWidth) * 0.1).toString() + \"px\";\r\n butEdit.top = (parseFloat(butEdit.left) * -1).toString() + \"px\";\r\n butEdit.verticalAlignment = Control.VERTICAL_ALIGNMENT_BOTTOM;\r\n butEdit.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n butEdit.thickness = 2;\r\n butEdit.color = buttonColor;\r\n butEdit.fontSize = buttonFontSize;\r\n butEdit.background = buttonBackgroundColor;\r\n butEdit.onPointerEnterObservable.add(() => {\r\n butEdit.background = buttonBackgroundHoverColor;\r\n });\r\n butEdit.onPointerOutObservable.add(() => {\r\n butEdit.background = buttonBackgroundColor;\r\n });\r\n butEdit.pointerDownAnimation = () => {\r\n butEdit.background = buttonBackgroundClickColor;\r\n };\r\n butEdit.pointerUpAnimation = () => {\r\n butEdit.background = buttonBackgroundHoverColor;\r\n };\r\n butEdit.onPointerClickObservable.add(() => {\r\n if (editSwatchMode) {\r\n editSwatchMode = false;\r\n } else {\r\n editSwatchMode = true;\r\n }\r\n editSwatches();\r\n });\r\n pickerGrid.addControl(butEdit, 1, 0);\r\n } else {\r\n pickerGrid.removeControl(butEdit);\r\n }\r\n }\r\n\r\n // Called when the user hits the limit of saved colors in the drawer.\r\n function disableButton(button: Button, disabled: boolean) {\r\n if (disabled) {\r\n button.color = buttonDisabledColor;\r\n button.background = buttonDisabledBackgroundColor;\r\n } else {\r\n button.color = buttonColor;\r\n button.background = buttonBackgroundColor;\r\n }\r\n }\r\n\r\n // Passes last chosen color back to scene and kills dialog by removing from AdvancedDynamicTexture\r\n function closePicker(color: string) {\r\n if (options.savedColors && options.savedColors.length > 0) {\r\n resolve({\r\n savedColors: options.savedColors,\r\n pickedColor: color,\r\n });\r\n } else {\r\n resolve({\r\n pickedColor: color,\r\n });\r\n }\r\n advancedTexture.removeControl(dialogContainer);\r\n }\r\n });\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.ColorPicker\", ColorPicker);\r\n"]}
|