lib_drawing_composite_types
// This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// credits to Trendoscope Pty Ltd (https://www.tradingview.com/script/63c8VXSa-DrawingTypes/)
//@version=5

import HeWhoMustNotBeNamed/DrawingTypes/2 as D

// @description User Defined Types for basic drawing structure. Other types and methods will be built on these. (added type Triangle and Polygon to https://www.tradingview.com/script/63c8VXSa-DrawingTypes/)
library("lib_drawing_composite_types", overlay = true)

// @type TriangleProperties object
// @field border_color Box border color. Default is color.blue
// @field fill_color Fill color
// @field transparency Fill transparency range from 0 to 100
// @field border_width Box border width. Default is 1
// @field border_style Box border style. Default is line.style_solid
// @field extend Extend property of box. default is extend.none
// @field xloc defines if drawing needs to be done based on bar index or time. default is xloc.bar_index
// @field object linefill object created from wrapper
export type TriangleProperties
	color border_color = chart.fg_color
	color fill_color = chart.fg_color
	int fill_transparency = 80
	int border_width = 1
	string border_style = line.style_solid
	string xloc = xloc.bar_index

// @type Triangle object
// @field p1 point one
// @field p2 point two
// @field p3 point three
// @field properties Triangle properties
// @field l12 line object created
// @field l23 line object created
// @field l31 line object created
export type Triangle
	D.Point p1
	D.Point p2
	D.Point p3
	TriangleProperties properties
	line l12
	line l23
	line l31


// @type Trianglefill object
// @field triangle to create a linefill for
// @field fill_color Fill color
// @field transparency Fill transparency range from 0 to 100
// @field object linefill object created
export type Trianglefill
	Triangle triangle
	color fill_color = chart.fg_color
	int transparency = 80
	linefill object
	

// @type Polygon object
// @field center Point that triangles are using as common center
// @field triangles an array of triangles that form the Polygon
export type Polygon
	D.Point center
	array<Triangle> triangles
	

// @type Polygonfill object
// @field _polygon to create a fill for
// @field _fills an array of Trianglefill objects that match the array of triangles in _polygon
export type Polygonfill
	Polygon _polygon
	array<Trianglefill> _fills
	