You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`ContentAlign` : Align the content inside the Box i.e. `Center`, `Left` and `Right`
56
-
-`Type`: Type of Box (by default it's Single) [*click this for more info*](./README.md/#box-types)
57
-
-`TitlePos` : Position of the Title i.e. `Inside`, `Top` and `Bottom`[*click this for more info*](./README.md/#title-positions)
58
-
-`Color` : Color of the Box[*click this for more info*](./README.md/#color-types)
57
+
-`Type`: Type of Box
58
+
-`TitlePos` : Position of the Title i.e. `Inside`, `Top` and `Bottom`
59
+
-`Color` : Color of the Box
59
60
60
61
### `Box struct` Methods
61
62
@@ -131,13 +132,13 @@ You can make your custom Box by using the inbuilt Box struct provided by the mod
131
132
132
133
```go
133
134
typeBoxstruct {
134
-
TopRightstring//TopRight corner used for Symbols
135
-
TopLeftstring//TopLeft corner used for Symbols
135
+
TopRightstring//Symbols used for TopRight Corner
136
+
TopLeftstring//Symbols used for TopLeft Corner
136
137
Verticalstring// Symbols used for Vertical Bars
137
-
BottomRightstring//BottomRight corner used for Symbols
138
-
BottomLeftstring//BotromLeft corner used for Symbols
138
+
BottomRightstring//Symbols used for BottomRight Corner
139
+
BottomLeftstring//Symbols used for BottomRight Corner
139
140
Horizontalstring// Symbols used for Horizontal Bars
140
-
Config//Configuration for the Box to be made
141
+
Config//Config for the Box struct
141
142
}
142
143
```
143
144
@@ -189,42 +190,46 @@ It has color support from [gookit/color](github.com/gookit/color) module from wh
189
190
190
191
If you want High Intensity Colors then the Color name must start with `Hi`. If Color option is empty or invalid then Box with default Color is formed.
191
192
192
-
True Color is possible though you need to provide it as `uint` or `[3]uint` and make sure that the terminals which will be targetted must have it supported.
193
+
1.True Color is also possible though you need to provide it as `uint` or `[3]uint` and make sure that the terminals which will be targetted must have it supported.
193
194
194
-
`[3]uint`'s element all must be in a range of `[0, 0xFF]` and `uint` in range of `[0x000000, 0xFFFFFF]`.
195
+
2.`[3]uint`'s element all must be in a range of `[0, 0xFF]` and `uint` in range of `[0x000000, 0xFFFFFF]`.
195
196
196
197
As convenience, if the terminal's doesn't support True Color then it will round off according to the terminal's max supported colors which makes it easier for the users not to worry about other terminal for most of the cases.
197
198
198
199
Here's a list of 24 bit [supported terminals](https://gist.github.com/XVilka/8346728) and 8 bit [supported terminals](https://fedoraproject.org/wiki/Features/256_Color_Terminals).
199
200
200
201
This module also enables **True Color** and **256 Colors** support on Windows Console through [Virtual Terminal Processing](https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences) but you need have at least [Windows 10 Version 1511](https://en.wikipedia.org/wiki/Windows_10_version_history_(version_1511)) for 256 colors or [Windows 10 Version 1607](https://en.wikipedia.org/wiki/Windows_10_version_history_(version_1607)) for True Color Support.
201
202
202
-
4 bit Color are now supported by every terminal now so there is no list for them unlike the above ones.
203
+
4-bit Colors are now standardized so it is supported by all terminals now.
204
+
205
+
If `ConEmu` or `ANSICON` is installed for Windows systems then it will be also detected. It is highly recommended to use the latest versions of both of them to have the best experience!
203
206
204
207
### Note
205
208
206
-
#### Vertical Alignment
209
+
#### 1. Vertical Alignment
207
210
208
211
As different terminals have different font by default so the right vertical alignment may not be aligned well. You will have to change your font accordingly to make it work.
209
212
210
-
#### Limitations of Unicode and Emoji
213
+
#### 2. Limitations of Unicode and Emoji
211
214
212
215
It uses [mattn/go-runewidth](https://github.com/mattn/go-runewidth) for Unicode and Emoji support though there are some limitations:
213
216
214
-
-`Windows Terminal` and `Mintty` are the only know terminal emulators which can render Unicode and Emojis properly on Windows.
217
+
-`Windows Terminal`, `ConEmu` and `Mintty` are the only know terminal emulators which can render Unicode and Emojis properly on Windows.
215
218
- Indic Text only works on very few Terminals as less support it.
216
219
- It is recommended not to use this for Online Playgrounds like [`Go Playground`](https://play.golang.org/) and [`Repl.it`](https://repl.it), `CI/CDs` etc. because they use a font that only has ASCII support and other Character Set is used which becomes problematic for finding the length as the font changes during runtime.
217
220
- Change your font which supports Unicode and Emojis else the right vertical alignment will break.
218
221
219
-
#### Terminal Color Detection
222
+
#### 3. Terminal Color Detection
220
223
221
224
It is possible to round off true color provided to 8 bit or 16 bit according to your terminal's maximum capacity.
222
225
223
-
There is no **standardized way** of detecting the terminal's maximum color capacity so the way of detecting your terminal might not work for you. If this can be fixed for you then you can always make a PR.
226
+
There is no **standardized way** of detecting the terminal's maximum color capacity so the way of detecting your terminal might not work for you. If this can be fixed for your terminal then you can always make a PR.
227
+
228
+
The following two points are just applicable for **Unix** systems:
224
229
225
-
If you think that the module can't detect True Color of the terminal then you must set your environment variable `COLORTERM` to `truecolor` or `24bit` for True Color support.
230
+
-If you think that the module can't detect True Color of the terminal then you must set your environment variable `COLORTERM` to `truecolor` or `24bit` for True Color support.
226
231
227
-
If you are targetting 8 bit color based terminals and if the module couln't detect it then set your environment variable `TERM` to name of the terminal emulator with `256color` as suffix like `xterm-256color`.
232
+
-If you are targetting 8 bit color based terminals and the module couln't detect it then set your environment variable `TERM` to name of the terminal emulator with `256color` as suffix like `xterm-256color`.
228
233
229
234
There might be no color effect for very old terminals like [`Windows Console (Legacy Mode)`](https://docs.microsoft.com/en-us/windows/console/legacymode) or environment variable `TERM` give `DUMB` so it will output some garbage value or a warning if used.
0 commit comments