diff --git a/src/semantic/src/site/globals/site.variables b/src/semantic/src/site/globals/site.variables index b29f6ad..4bba56b 100644 --- a/src/semantic/src/site/globals/site.variables +++ b/src/semantic/src/site/globals/site.variables @@ -2,4 +2,4 @@ User Global Variables *******************************/ -@primaryColor: #61518f; +@primaryColor: #197052; diff --git a/src/semantic/src/themes/default/globals/reset.overrides b/src/semantic/src/themes/default/globals/reset.overrides index 192eb9c..40057e5 100644 --- a/src/semantic/src/themes/default/globals/reset.overrides +++ b/src/semantic/src/themes/default/globals/reset.overrides @@ -147,6 +147,8 @@ sup { img { border-style: none; + max-width: 100%; + height: auto; } /* Forms diff --git a/src/static-pages/vereniging/huisstijl.jsx b/src/static-pages/vereniging/huisstijl.jsx index 168a906..e76aba2 100644 --- a/src/static-pages/vereniging/huisstijl.jsx +++ b/src/static-pages/vereniging/huisstijl.jsx @@ -71,6 +71,52 @@ const tdStyle = { padding: '10px', }; +function rgbToCymk(rgb) { + let computedC = 1 - rgb.r / 255; + let computedM = 1 - rgb.g / 255; + let computedY = 1 - rgb.b / 255; + + let minCMY = Math.min(computedC, Math.min(computedM, computedY)); + computedC = Math.round(((computedC - minCMY) / (1 - minCMY)) * 100); + computedY = Math.round(((computedY - minCMY) / (1 - minCMY)) * 100); + computedM = Math.round(((computedM - minCMY) / (1 - minCMY)) * 100); + let computedK = Math.round(minCMY * 100); + + return { + c: computedC, + y: computedY, + m: computedM, + k: computedK, + }; +} + +function hexToRgb(hex) { + // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") + let shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; + hex = hex.replace(shorthandRegex, function(m, r, g, b) { + return r + r + g + g + b + b; + }); + + let result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result + ? { + r: parseInt(result[1], 16), + g: parseInt(result[2], 16), + b: parseInt(result[3], 16), + } + : null; +} + +function cymkColor(hex) { + const cymk = rgbToCymk(hexToRgb(hex)); + return `${cymk.c}%, ${cymk.y}%, ${cymk.m}%, ${cymk.k}%`; +} + +function rgbColor(hex) { + const rgb = hexToRgb(hex); + return `${rgb.r}, ${rgb.g}, ${rgb.b}`; +} + const Huisstijl = props => { const language = typeof window !== 'undefined' @@ -116,11 +162,15 @@ const Huisstijl = props => { CYMK - 0%, 94%, 83%, 50% + + {cymkColor(props.data.contentfulBoard.color)} + RGB - 128, 8, 22 + + {rgbColor(props.data.contentfulBoard.color)} + HEX