dev #84
|
@ -7,7 +7,7 @@ export const contrastColor = (color: ralTypes) => {
|
||||||
if (hex) {
|
if (hex) {
|
||||||
const hsl = { h: 0, s: 0, l: 0 }
|
const hsl = { h: 0, s: 0, l: 0 }
|
||||||
new Color(hex).getHSL(hsl)
|
new Color(hex).getHSL(hsl)
|
||||||
if (hsl.l < 0.5) {
|
if (hsl.l < 0.45) {
|
||||||
return '#fff'
|
return '#fff'
|
||||||
} else {
|
} else {
|
||||||
return '#000'
|
return '#000'
|
||||||
|
|
|
@ -82,22 +82,13 @@ const m_onBeforeCompile = (shader) => {
|
||||||
}
|
}
|
||||||
${shader.fragmentShader}
|
${shader.fragmentShader}
|
||||||
`
|
`
|
||||||
// .replace(
|
|
||||||
// `#include <map_fragment>`,
|
|
||||||
// `
|
|
||||||
// float noise_v = noise(diffuseColor.rg);
|
|
||||||
// float clamped_noise = clamp(noise_v, -0.15, 0.15);
|
|
||||||
// diffuseColor.rgb *= clamped_noise;
|
|
||||||
// #include <map_fragment>
|
|
||||||
// `
|
|
||||||
// )
|
|
||||||
.replace(
|
.replace(
|
||||||
`#include <dithering_fragment>`,
|
`#include <dithering_fragment>`,
|
||||||
`#include <dithering_fragment>
|
`#include <dithering_fragment>
|
||||||
|
|
||||||
float noise_v = noise(gl_FragColor.rg);
|
float noise_v = noise(gl_FragColor.rg);
|
||||||
float clamped_noise = clamp(noise_v, -0.05, 0.05);
|
float clamped_noise = clamp(noise_v, 0.85, 1.0);
|
||||||
gl_FragColor.rgb -= clamp(vec3(clamped_noise), 0.0, 1.0);
|
gl_FragColor.rgb *= vec3(clamped_noise);
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue