# Is there a way to paint a filled triangle?

**URL:** <https://discourse.processing.org/t/is-there-a-way-to-paint-a-filled-triangle/31647>\
**Category:** Beginners\
**Created:** [August 9, 2021, 3:49pm UTC](https://discourse.processing.org/t/is-there-a-way-to-paint-a-filled-triangle/31647 "2021-08-09T15:49:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yalaniv](https://avatars.discourse-cdn.com/v4/letter/y/7993a0/32.png) [@yalaniv](https://discourse.processing.org/u/yalaniv)\
**Post date:** [August 9, 2021, 3:49pm UTC](https://discourse.processing.org/t/is-there-a-way-to-paint-a-filled-triangle/31647/1 "2021-08-09T15:49:44Z")

</div>

I would like to know

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [August 9, 2021, 5:03pm UTC](https://discourse.processing.org/t/is-there-a-way-to-paint-a-filled-triangle/31647/2 "2021-08-09T17:03:35Z")

</div>

hi

read this  
[https://processing.org/reference/fill\_.html](https://processing.org/reference/fill_.html)

[https://forum.processing.org/two/discussion/2866/simple-paint-program](https://forum.processing.org/two/discussion/2866/simple-paint-program)

---

<div class="post-metadata">

**Author:** ![yalaniv](https://avatars.discourse-cdn.com/v4/letter/y/7993a0/32.png) [@yalaniv](https://discourse.processing.org/u/yalaniv)\
**Post date:** [August 9, 2021, 5:26pm UTC](https://discourse.processing.org/t/is-there-a-way-to-paint-a-filled-triangle/31647/3 "2021-08-09T17:26:48Z")

</div>

Thanks jafal,  
I’m familiar with the function fill().

My question was specific about triangle.  
I know I can draw an ellipse or rectange, but I want to draw filled triangle

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [August 9, 2021, 5:30pm UTC](https://discourse.processing.org/t/is-there-a-way-to-paint-a-filled-triangle/31647/4 "2021-08-09T17:30:55Z")

</div>

You can create your own shapes:

[https://processing.org/reference/beginShape\_.html](https://processing.org/reference/beginShape_.html)

`:)`

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [August 9, 2021, 5:31pm UTC](https://discourse.processing.org/t/is-there-a-way-to-paint-a-filled-triangle/31647/5 "2021-08-09T17:31:08Z")

</div>

> [@yalaniv](#):
>
> Thanks jafal,  
> I’m familiar with the function fill().

see this move your mouse

```auto
void setup () {
size (600,600);
colorMode(HSB);
}
void draw(){
for(int i= 500; i >0; i=i -2) {
  fill((i/5) + (mouseX/3), 225,255);
//rect(i,1,i,height);
triangle(30, 75, 58, 20, 86, 75);
}
}

```

edit

> **[triangle() / Reference](https://processing.org/reference/triangle_.html)**
>
> A triangle is a plane created by connecting three points. The first two arguments specify the first point, the middle two arguments specify the second point, and the last two arguments specify the thi…

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [August 9, 2021, 6:40pm UTC](https://discourse.processing.org/t/is-there-a-way-to-paint-a-filled-triangle/31647/6 "2021-08-09T18:40:13Z")

</div>

Hello @yalaniv,

A good place to start looking is here:

> **Click here for resources**
>
> I encourage you to look at the resources available here:
> 
> **Beginner**
> 
> - The Processing website has _references_ , _examples_ , _tutorials_ , etc.  
> [https://processing.org/](https://processing.org/)
> - The Processing PDE (IDE) has lots to offer!  
> An exploration of the menu items will reveal what is available!  
> You will find _libraries_ , _tools_ , _examples_ and more!  
> For example:  
> ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/d1f59b878cb30a4047dbfd8407702c77bc49bca6.png)
> - The Coding Train  
> [https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1\_aw](https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw)  
> [https://thecodingtrain.com/](https://thecodingtrain.com/)
> - Happy Coding  
> [https://happycoding.io/tutorials/processing/](https://happycoding.io/tutorials/processing/)
> 
> **Advanced**
> 
> - The source code can give insight if you are adventurous:  
> [GitHub - processing/processing: Source code for the Processing Core and Development Environment (PDE)](https://github.com/processing/processing)  
> Many of the Processing functions are here:  
> [https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java](https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java)
> - And the Internet.

The references have all the shapes with examples.

`:)`

---

<div class="post-metadata">

**Author:** ![yalaniv](https://avatars.discourse-cdn.com/v4/letter/y/7993a0/32.png) [@yalaniv](https://discourse.processing.org/u/yalaniv)\
**Post date:** [August 16, 2021, 2:22pm UTC](https://discourse.processing.org/t/is-there-a-way-to-paint-a-filled-triangle/31647/7 "2021-08-16T14:22:04Z")

</div>

triangle() is the things I’ve been looking for but didn’t know it exist 🙂

Thanks
