Skip to content

Commit

Permalink
Merge pull request #151 from reaviz/Add-transparent-backgrounds
Browse files Browse the repository at this point in the history
Add transparent backgrounds
  • Loading branch information
amcdnl authored Dec 7, 2023
2 parents cbbc3b0 + 4348e22 commit 2cd127e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/GraphCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,12 @@ export const GraphCanvas: FC<GraphCanvasProps & { ref?: Ref<GraphCanvasRef> }> =
})
}
>
<color attach="background" args={[theme.canvas.background]} />
{theme.canvas?.background && (
<color attach="background" args={[theme.canvas.background]} />
)}
<ambientLight intensity={1} />
{children}
{theme.canvas.fog && (
{theme.canvas?.fog && (
<fog attach="fog" args={[theme.canvas.fog, 4000, 9000]} />
)}
<CameraControls
Expand Down
4 changes: 2 additions & 2 deletions src/themes/theme.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ColorRepresentation } from 'three';

export interface Theme {
canvas: {
background: ColorRepresentation;
canvas?: {
background?: ColorRepresentation;
fog?: ColorRepresentation | null;
};
node: {
Expand Down

0 comments on commit 2cd127e

Please sign in to comment.