# How to force not to add colors with transparent 3D objects

**URL:** <https://discourse.julialang.org/t/how-to-force-not-to-add-colors-with-transparent-3d-objects/104216>\
**Category:** Visualization\
**Created:** [September 25, 2023, 12:04pm UTC](https://discourse.julialang.org/t/how-to-force-not-to-add-colors-with-transparent-3d-objects/104216 "2023-09-25T12:04:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peremato](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peremato/32/29128_2.png) [@peremato](https://discourse.julialang.org/u/peremato)\
**Post date:** [September 25, 2023, 12:04pm UTC](https://discourse.julialang.org/t/how-to-force-not-to-add-colors-with-transparent-3d-objects/104216/1 "2023-09-25T12:04:20Z")

</div>

In GLMakie I would like that the color I use for `lines` is not added to the transparent 3D `mesh` object. For example

```julia
using GLMakie
using GeometryBasics

fig = Figure(resolution=(1280, 720))
scene = LScene(fig[1,1])
box = Rect3f(Vec3f(-0.5), Vec3f(1))
mesh!(scene, box, color=:lightgray, transparency=true)
lines!(scene, [Vec3f(-2,0,0),Vec3f(2,0,0)], color=:yellow)

```

produces,

 ![](https://global.discourse-cdn.com/julialang/original/3X/2/d/2d4810579933bef284f46221684c61456ea907ec.png)  
and I would like that the line crossing the cube maintains the yellow color.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [September 25, 2023, 12:09pm UTC](https://discourse.julialang.org/t/how-to-force-not-to-add-colors-with-transparent-3d-objects/104216/2 "2023-09-25T12:09:24Z")

</div>

You need to give the cube a transparent color, e.g (:lightgray, 0.5), and best give lines transparency=true as well!

---

<div class="post-metadata">

**Author:** ![peremato](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peremato/32/29128_2.png) [@peremato](https://discourse.julialang.org/u/peremato)\
**Post date:** [September 25, 2023, 12:19pm UTC](https://discourse.julialang.org/t/how-to-force-not-to-add-colors-with-transparent-3d-objects/104216/3 "2023-09-25T12:19:44Z")

</div>

Yes, it is better, but still is adding the colors. I really would like that yellow inside the cube stays identical to the outside one.
