Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to use black in COLOR_PALETTE #12

Open
shaun-visser opened this issue May 8, 2024 · 2 comments
Open

Not able to use black in COLOR_PALETTE #12

shaun-visser opened this issue May 8, 2024 · 2 comments

Comments

@shaun-visser
Copy link

Love the work!
Setting canvas to a white background - I'm not able to set black in the color pallet e.g.
useEffect(() => {
webGLFluidEnhanced.simulation(canvasRef.current!, {
SIM_RESOLUTION: 128, // Resolution of the simulation grid
DYE_RESOLUTION: 1024, // Resolution of the dye grid
CAPTURE_RESOLUTION: 512, // Resolution of captured frames
DENSITY_DISSIPATION: 1, // Rate at which density dissipates
VELOCITY_DISSIPATION: 0.2, // Rate at which velocity dissipates
PRESSURE: 0.8, // Pressure value used in the simulation
PRESSURE_ITERATIONS: 20, // Number of pressure iterations
CURL: 10, // Curl value used in the simulation
INITIAL: false, // Enables splats on initial load
SPLAT_AMOUNT: 5, // Number of initial splats (Random number between n and n * 5)
SPLAT_RADIUS: 0.25, // Radius of the splats
SPLAT_FORCE: 6000, // Force applied by the splats
SPLAT_KEY: '', // Keyboard key to spawn new splats (empty to disable)
SHADING: false, // Enables shading in the visualization
COLORFUL: true, // Enables rapid changing of colors
COLOR_UPDATE_SPEED: 10, // Speed of color update
COLOR_PALETTE: ['#000000', '#000000', '#000000', '#000000', '#000000'], // Custom color palette (empty by default, uses hex colors)
HOVER: true, // Enables interaction on hover
BACK_COLOR: '#ffffff', // Background color of the canvas
TRANSPARENT: false, // Makes the canvas transparent if true
BRIGHTNESS: 1, // Color brightness (Recommend lower than 1.0 if BLOOM is true)
BLOOM: false, // Enables bloom effect
BLOOM_ITERATIONS: 8, // Number of bloom effect iterations
BLOOM_RESOLUTION: 256, // Resolution of the bloom effect
BLOOM_INTENSITY: 0.8, // Intensity of the bloom effect
BLOOM_THRESHOLD: 0.6, // Threshold for the bloom effect
BLOOM_SOFT_KNEE: 0.7, // Soft knee value for the bloom effect
SUNRAYS: false, // Enables sunrays effect
SUNRAYS_RESOLUTION: 196, // Resolution of the sunrays effect
SUNRAYS_WEIGHT: 1.0, // Weight of the sunrays effect
});
}, []);

@michaelbrusegard
Copy link
Owner

michaelbrusegard commented Jun 28, 2024

I think that is a limitation of how the library calculates colors. I will take a look at a feature to fix it when I have time

@michaelbrusegard
Copy link
Owner

I have a large upcoming rewrite of the package that solves this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants