Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How do you change the background color of the dark veil background? #381

bardium started this conversation in General
Discussion options

How do I change the backgrond of this because it's #000 and I can't find how to change it, there doesn't seem to be a prop for it and gl.clearColor(...) isn't working.

https://www.reactbits.dev/backgrounds/dark-veil

You must be logged in to vote

Replies: 2 comments

Comment options

bro, you can't change it, but i used Claude to generate another fragment to run the ogl with, for light mode and dark mode using next-themes, but it is not working properly for light mode tho, the accent color is less saturated
below is my implementation
hero-background.txt

You must be logged in to vote
0 replies
Comment options

@bardium You can replace your void main() function in the shader with the one below:

void main(){
 vec4 col;mainImage(col,gl_FragCoord.xy);
 col.rgb=hueShiftRGB(col.rgb,uHueShift);
 float scanline_val=sin(gl_FragCoord.y*uScanFreq)*0.5+0.5;
 col.rgb*=1.-(scanline_val*scanline_val)*uScan;
 col.rgb+=(rand(gl_FragCoord.xy+uTime)-0.5)*uNoise;
 col.rgb=clamp(col.rgb,0.0,1.0);
 float luma=dot(col.rgb,vec3(0.2126,0.7152,0.0722));
 float alpha=smoothstep(0.0,0.08,luma);
 vec3 bg=vec3(1.0);
 vec3 outCol=mix(bg,col.rgb,alpha);
 gl_FragColor=vec4(outCol,1.0);
}
`;

This will give you a white background. Unfortunately, it doesn't look so great, because this component was designed for dark mode designs.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /