@buerli.io/core 0.7.1-beta.2 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -55,7 +55,8 @@ class ThreeGeometryCreator {
|
|
|
55
55
|
color = geomProps.material.color || color;
|
|
56
56
|
opacity = geomProps.material.opacity || opacity;
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
// Provide values as a CSS color string, which will be gamma corrected by three.js
|
|
59
|
+
const rgbColor = color ? new THREE.Color(`rgb(${color[0]}, ${color[1]}, ${color[2]})`) : undefined;
|
|
59
60
|
const layer = geomProps && geomProps.layer ? geomProps.layer : container.properties.layer;
|
|
60
61
|
return {
|
|
61
62
|
color: rgbColor,
|
|
@@ -74,7 +74,8 @@ const geometryApi = (set, get, buerliApi) => ({
|
|
|
74
74
|
return geom;
|
|
75
75
|
},
|
|
76
76
|
setColor: (containerId, r, g, b) => {
|
|
77
|
-
|
|
77
|
+
// Provide values as a CSS color string, which will be gamma corrected by three.js
|
|
78
|
+
const color = new THREE.Color(`rgb(${Math.round(r * 255)}, ${Math.round(g * 255)}, ${Math.round(b * 255)})`);
|
|
78
79
|
const cachedGeom = Object.assign(Object.assign({}, get().geometry.cache[containerId]), { color });
|
|
79
80
|
set(state => ({
|
|
80
81
|
geometry: Object.assign(Object.assign({}, state.geometry), { cache: Object.assign(Object.assign({}, state.geometry.cache), { [containerId]: Object.assign(Object.assign({}, cachedGeom), { dirtyStamp: Date.now() }) }) }),
|
|
@@ -29,7 +29,8 @@ export class ThreeGeometryCreator {
|
|
|
29
29
|
color = geomProps.material.color || color;
|
|
30
30
|
opacity = geomProps.material.opacity || opacity;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
// Provide values as a CSS color string, which will be gamma corrected by three.js
|
|
33
|
+
const rgbColor = color ? new THREE.Color(`rgb(${color[0]}, ${color[1]}, ${color[2]})`) : undefined;
|
|
33
34
|
const layer = geomProps && geomProps.layer ? geomProps.layer : container.properties.layer;
|
|
34
35
|
return {
|
|
35
36
|
color: rgbColor,
|
|
@@ -47,7 +47,8 @@ export const geometryApi = (set, get, buerliApi) => ({
|
|
|
47
47
|
return geom;
|
|
48
48
|
},
|
|
49
49
|
setColor: (containerId, r, g, b) => {
|
|
50
|
-
|
|
50
|
+
// Provide values as a CSS color string, which will be gamma corrected by three.js
|
|
51
|
+
const color = new THREE.Color(`rgb(${Math.round(r * 255)}, ${Math.round(g * 255)}, ${Math.round(b * 255)})`);
|
|
51
52
|
const cachedGeom = Object.assign(Object.assign({}, get().geometry.cache[containerId]), { color });
|
|
52
53
|
set(state => ({
|
|
53
54
|
geometry: Object.assign(Object.assign({}, state.geometry), { cache: Object.assign(Object.assign({}, state.geometry.cache), { [containerId]: Object.assign(Object.assign({}, cachedGeom), { dirtyStamp: Date.now() }) }) }),
|