| 1 | // Copyright 2025 The TCell Authors |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | package vt |
| 15 | |
| 16 | // Attr is a synthetic combination of display attributes for cells, apart |
| 17 | // from color which is handled separately. |
| 18 | type Attr uint16 |
| 19 | |
| 20 | const ( |
| 21 | Plain = Attr(0) // basic, plain style |
| 22 | Bold = Attr(1 << 0) // maybe double strike, or just brighter |
| 23 | Blink = Attr(1 << 1) // NB: many terminals do not support it |
| 24 | Reverse = Attr(1 << 2) // foreground and background reversed |
| 25 | Dim = Attr(1 << 3) // fainter, may also be lower alpha |
| 26 | Italic = Attr(1 << 4) // italicized |
| 27 | StrikeThrough = Attr(1 << 5) // crossed-out |
| 28 | Underline = Attr(1 << 6) // any underline style |
| 29 | Overline = Attr(1 << 7) // rarely supported |
| 30 | |
| 31 | // Underline styles, always mixed with underline, only one can be selected |
| 32 | PlainUnderline = Underline |
| 33 | DoubleUnderline = Underline | 1<<13 |
| 34 | CurlyUnderline = Underline | 2<<13 |
| 35 | DottedUnderline = Underline | 3<<13 |
| 36 | DashedUnderline = Underline | 4<<13 |
| 37 | UnderlineMask = Underline | 7<<13 // bits 13, 14, 15 |
| 38 | ) |