diff --git a/types/color.go b/types/color.go index 63ccd71d6..b0df8c892 100644 --- a/types/color.go +++ b/types/color.go @@ -3,25 +3,3 @@ package types const Green = "#228B22" const Red = "#800000" -// SideType define side type of order -type SideType string - -const ( - SideTypeBuy = SideType("BUY") - SideTypeSell = SideType("SELL") -) - -func (side SideType) Color() string { - if side == SideTypeBuy { - return Green - } - if side == SideTypeSell { - return Red - } - - return "#f0f0f0" -} - -func SideToColorName(side SideType) string { - return side.Color() -} diff --git a/types/side.go b/types/side.go new file mode 100644 index 000000000..7fd24785b --- /dev/null +++ b/types/side.go @@ -0,0 +1,24 @@ +package types + +// SideType define side type of order +type SideType string + +const ( + SideTypeBuy = SideType("BUY") + SideTypeSell = SideType("SELL") +) + +func (side SideType) Color() string { + if side == SideTypeBuy { + return Green + } + if side == SideTypeSell { + return Red + } + + return "#f0f0f0" +} + +func SideToColorName(side SideType) string { + return side.Color() +}