diff options
-rw-r--r-- | index.html | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/index.html b/index.html index 64a2990..ba59d06 100644 --- a/index.html +++ b/index.html @@ -31,6 +31,17 @@ let ILLUMINANT_D65 = [ 0.950489, 1.0, 1.088840 ]; function main() { let svgState = svgInit(); + generateColorWheel(svgState); + + let colorSelectionDotParameters = { + x: 5000, + y: -5000, + }; + + generateColorSelectionDot(svgState, colorSelectionDotParameters); +} + +function generateColorWheel(svgState) { let colorWheelParameters = { scale: 10000, nStepsAround: 128, @@ -131,6 +142,34 @@ function generateOneColorWheelChunk(svgState, colorWheelParameters, chunkParamet } +function generateColorSelectionDot(svgState, colorSelectionDotParameters) { + let dotId = svgGenerateId(svgState, 'colorSelectionDot'), + translateParameters = [ + colorSelectionDotParameters.x, + colorSelectionDotParameters.y + ]; + + let transform = 'translate(' + translateParameters.join(',') + ')'; + + let groupElement = document.createElementNS(svgState.SVG_NS, 'g'); + groupElement.setAttribute('id', dotId); + groupElement.setAttribute('transform', transform); + + let blackCircleElement = document.createElementNS(svgState.SVG_NS, 'circle'); + blackCircleElement.setAttribute('r', '200'); + blackCircleElement.setAttribute('fill', 'black'); + groupElement.appendChild(blackCircleElement); + + let whiteCircleElement = document.createElementNS(svgState.SVG_NS, 'circle'); + whiteCircleElement.setAttribute('r', '150'); + whiteCircleElement.setAttribute('stroke', 'white'); + whiteCircleElement.setAttribute('stroke-width', '50'); + groupElement.appendChild(whiteCircleElement); + + svgState.svgElement.appendChild(groupElement); +} + + function svgInit() { let svgState = { }; |