function getMaterial() {
  const material = new THREE.MeshStandardMaterial({color: 0x5186a6, metalness: .1, roughness: .1});
  material.onBeforeCompile = (shader) =>{
    shader.vertexShader = shader.vertexShader.replace(
      `varying vec3 vViewPosition;`,
      `varying vec3 vViewPosition;
  varying vec3 vObjectNormal;`);
    shader.vertexShader = shader.vertexShader.replace(
      `#include <defaultnormal_vertex>`,
      `#include <defaultnormal_vertex>
  vObjectNormal = objectNormal.xyz;`);

   shader.fragmentShader = shader.fragmentShader.replace(
      `varying vec3 vViewPosition;`,
      `varying vec3 vViewPosition;
  varying vec3 vObjectNormal;`);

   shader.fragmentShader = shader.fragmentShader.replace(
      `vec4 diffuseColor = vec4( diffuse, opacity );`,
      `vec4 diffuseColor = vec4( diffuse, opacity );
      if(abs(vObjectNormal.z)>.5) diffuseColor.rgb += vec3(129.,200.,169.) / 255.;
      if(abs(vObjectNormal.x)>.5) diffuseColor.rgb += vec3(55.,60.,148.) / 255.;`);
  }
  return material;
}
Based on https://dribbble.com/shots/1783699-Blocks