|
@@ -145,6 +145,13 @@ const onColorChanged = (state, newValue) => {
|
|
|
}
|
|
|
const { J, a, b } = d3.jab(rgb);
|
|
|
|
|
|
+ if (state.target) {
|
|
|
+ const lastColor = document.createElement("div");
|
|
|
+ lastColor.innerHTML = state.target.rgb.hex;
|
|
|
+ lastColor.style = `color: ${getContrastingTextColor(state.target.rgb.hex)}; background-color: ${state.target.rgb.hex}; width: 6em; text-align: center;`;
|
|
|
+ document.getElementById("prev-colors").prepend(lastColor);
|
|
|
+ }
|
|
|
+
|
|
|
state.target = {
|
|
|
jab: buildVectorData([J, a, b], jab2hue, jab2lit, jab2chroma, jab2hex),
|
|
|
rgb: buildVectorData([rgb.r, rgb.g, rgb.b], rgb2hue, rgb2lit, rgb2chroma, rgb2hex),
|