# Visually show when 2 pshape lines cross - transparency?

**URL:** https://discourse.processing.org/t/visually-show-when-2-pshape-lines-cross-transparency/17694
**Category:** Project Guidance
**Created:** [February 10, 2020, 5:27pm UTC](https://discourse.processing.org/t/visually-show-when-2-pshape-lines-cross-transparency/17694 "2020-02-10T17:27:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://discourse.processing.org/u/martinh)
#### Post date: [February 10, 2020, 5:27pm UTC](https://discourse.processing.org/t/visually-show-when-2-pshape-lines-cross-transparency/17694/1 "2020-02-10T17:27:22Z")

</div>

Hi, I’m simply drawing lines for a schematic program using PShapes, and I want some visual indication when lines cross. I’d like to do this by controlling the transparency of the PShape lines so that a crossing would show darker at the at location.

I’ve looked at a lot of threads, talking about tints, alpha, etc, but nothing is what I’m looking for or I’m missing something simple.

Suggestions? Thanks!

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [February 10, 2020, 11:16pm UTC](https://discourse.processing.org/t/visually-show-when-2-pshape-lines-cross-transparency/17694/2 "2020-02-10T23:16:58Z")

</div>

Can you please show your code or relevant part

---

<div class="post-metadata">

### Author: ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://discourse.processing.org/u/martinh)
#### Post date: [February 11, 2020, 3:41am UTC](https://discourse.processing.org/t/visually-show-when-2-pshape-lines-cross-transparency/17694/3 "2020-02-11T03:41:39Z")

</div>

Hi Chrisir,  
It’s not very exciting code, I’ll just post a fragment here. As the user draws, it adds sections to the “hose” in grey, then when done, it turns blue.

```
 voidaddHose(intlastX, lastY, endY){
    hose = createShape(LINE,lastX, lastY, lastX, endY);
    
    hose.setStroke(128);// draw in gray as hoses are added    hose.setStrokeWeight(10.0);
    
    hoseGroup.addChild(hose);
    hosepart++;
    created = true;
  }
  
  voidfinish(){
    hoseGroup.disableStyle();
    stroke(0,0,150);// draw in blue once completed all hoses    strokeWeight(10);
    shape(hoseGroup);
  }
```

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [February 11, 2020, 9:35am UTC](https://discourse.processing.org/t/visually-show-when-2-pshape-lines-cross-transparency/17694/4 "2020-02-11T09:35:49Z")

</div>

You can work with smaller opacity - see fill in the reference

Also look at blendMode() in the reference

---

<div class="post-metadata">

### Author: ![martinh](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@martinh](https://discourse.processing.org/u/martinh)
#### Post date: [February 11, 2020, 11:41am UTC](https://discourse.processing.org/t/visually-show-when-2-pshape-lines-cross-transparency/17694/5 "2020-02-11T11:41:01Z")

</div>

Thanks, I’ll check out blendMode(), also I just got alpha to work with stroke().  
-MH
