# Drawing Triangles on the Canvas

**URL:** https://forum.kirupa.com/t/drawing-triangles-on-the-canvas/355829
**Category:** programming
**Created:** [November 24, 2014, 5:43am UTC](https://forum.kirupa.com/t/drawing-triangles-on-the-canvas/355829 "2014-11-24T05:43:32Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [November 24, 2014, 5:43am UTC](https://forum.kirupa.com/t/drawing-triangles-on-the-canvas/355829/1 "2014-11-24T05:43:33Z")

</div>

by [kirupa](http://www.kirupa.com/me/index.htm) | 26 October 2014

When you are working with the canvas element in HTML, you have some built-in functions that help you easily draw common shapes like circles, squares, and lines. Guess what shape you don't have a built-in function to help you easily draw?

* * *
This is a companion discussion topic for the original entry at [http://www.kirupa.com/html5/drawing\_triangles\_on\_the\_canvas.htm](http://www.kirupa.com/html5/drawing_triangles_on_the_canvas.htm)

---

<div class="post-metadata">

### Author: ![carlos\_medrano](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/carlos_medrano/32/11644_2.png) [@carlos\_medrano](https://forum.kirupa.com/u/carlos_medrano)
#### Post date: [May 6, 2020, 6:50pm UTC](https://forum.kirupa.com/t/drawing-triangles-on-the-canvas/355829/2 "2020-05-06T18:50:32Z")

</div>

Hey there, thanks for the tutorial, you just saved me a lot of work and got things already working. Just out of curiosity -and off-topic-, does the hex value for the yellow in the examples has any relation with the old AltaVista search engine? I know it has nothing to do with the tutorial, I just happen to be very curious about it. As for the rest, you seriously made things simpler for me, thanks!

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [May 6, 2020, 8:52pm UTC](https://forum.kirupa.com/t/drawing-triangles-on-the-canvas/355829/3 "2020-05-06T20:52:47Z")

</div>

Hi @carlos_medrano! Welcome to the forums 😛

That’s an interesting observation haha. I forgot what the yellow in AltaVista looked like, so here it is in case others are in a similar boat:

 ![image](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/2X/0/0008da0a42527a3526a94e4cbeb0c440888f369f.jpeg)

I just went with that yellow color since it breaks up the blues and dark text found throughout the site. Maybe subconsciously I was remembering the old AltaVista days! Who knows?

🤖

---

<div class="post-metadata">

### Author: ![carlos\_medrano](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/carlos_medrano/32/11644_2.png) [@carlos\_medrano](https://forum.kirupa.com/u/carlos_medrano)
#### Post date: [May 7, 2020, 3:42am UTC](https://forum.kirupa.com/t/drawing-triangles-on-the-canvas/355829/4 "2020-05-07T03:42:43Z")

</div>

Hahahaha that’s awesome! I asked because it was basically the first color I ever used back in the days -or should I say decades- when AltaVista was a thing and I tried to resemble what was already out there in the market. However, you made a very good point, since it does provides a great contrast with the other colors. Thanks again for the tutorial and I appreciate to be part of your community.

Best regards!
