package lipgloss
import (
)
func ( Style) () bool {
return .getAsBool(boldKey, false)
}
func ( Style) () bool {
return .getAsBool(italicKey, false)
}
func ( Style) () bool {
return .ul != UnderlineNone
}
func ( Style) () Underline {
return .ul
}
func ( Style) () color.Color {
return .getAsColor(underlineColorKey)
}
func ( Style) () bool {
return .getAsBool(strikethroughKey, false)
}
func ( Style) () bool {
return .getAsBool(reverseKey, false)
}
func ( Style) () bool {
return .getAsBool(blinkKey, false)
}
func ( Style) () bool {
return .getAsBool(faintKey, false)
}
func ( Style) () color.Color {
return .getAsColor(foregroundKey)
}
func ( Style) () color.Color {
return .getAsColor(backgroundKey)
}
func ( Style) () int {
return .getAsInt(widthKey)
}
func ( Style) () int {
return .getAsInt(heightKey)
}
func ( Style) () Position {
:= .getAsPosition(alignHorizontalKey)
if == Position(0) {
return Left
}
return
}
func ( Style) () Position {
:= .getAsPosition(alignHorizontalKey)
if == Position(0) {
return Left
}
return
}
func ( Style) () Position {
:= .getAsPosition(alignVerticalKey)
if == Position(0) {
return Top
}
return
}
func ( Style) () (, , , int) {
return .getAsInt(paddingTopKey),
.getAsInt(paddingRightKey),
.getAsInt(paddingBottomKey),
.getAsInt(paddingLeftKey)
}
func ( Style) () int {
return .getAsInt(paddingTopKey)
}
func ( Style) () int {
return .getAsInt(paddingRightKey)
}
func ( Style) () int {
return .getAsInt(paddingBottomKey)
}
func ( Style) () int {
return .getAsInt(paddingLeftKey)
}
func ( Style) () rune {
:= .getAsRune(paddingCharKey)
if == 0 {
return ' '
}
return
}
func ( Style) () int {
return .getAsInt(paddingLeftKey) + .getAsInt(paddingRightKey)
}
func ( Style) () int {
return .getAsInt(paddingTopKey) + .getAsInt(paddingBottomKey)
}
func ( Style) () bool {
return .getAsBool(colorWhitespaceKey, false)
}
func ( Style) () (, , , int) {
return .getAsInt(marginTopKey),
.getAsInt(marginRightKey),
.getAsInt(marginBottomKey),
.getAsInt(marginLeftKey)
}
func ( Style) () int {
return .getAsInt(marginTopKey)
}
func ( Style) () int {
return .getAsInt(marginRightKey)
}
func ( Style) () int {
return .getAsInt(marginBottomKey)
}
func ( Style) () int {
return .getAsInt(marginLeftKey)
}
func ( Style) () rune {
:= .getAsRune(marginCharKey)
if == 0 {
return ' '
}
return
}
func ( Style) () int {
return .getAsInt(marginLeftKey) + .getAsInt(marginRightKey)
}
func ( Style) () int {
return .getAsInt(marginTopKey) + .getAsInt(marginBottomKey)
}
func ( Style) () ( Border, , , , bool) {
return .getBorderStyle(),
.getAsBool(borderTopKey, false),
.getAsBool(borderRightKey, false),
.getAsBool(borderBottomKey, false),
.getAsBool(borderLeftKey, false)
}
func ( Style) () Border {
return .getBorderStyle()
}
func ( Style) () bool {
return .getAsBool(borderTopKey, false)
}
func ( Style) () bool {
return .getAsBool(borderRightKey, false)
}
func ( Style) () bool {
return .getAsBool(borderBottomKey, false)
}
func ( Style) () bool {
return .getAsBool(borderLeftKey, false)
}
func ( Style) () color.Color {
return .getAsColor(borderTopForegroundKey)
}
func ( Style) () color.Color {
return .getAsColor(borderRightForegroundKey)
}
func ( Style) () color.Color {
return .getAsColor(borderBottomForegroundKey)
}
func ( Style) () color.Color {
return .getAsColor(borderLeftForegroundKey)
}
func ( Style) () []color.Color {
return .getAsColors(borderForegroundBlendKey)
}
func ( Style) () int {
return .getAsInt(borderForegroundBlendOffsetKey)
}
func ( Style) () color.Color {
return .getAsColor(borderTopBackgroundKey)
}
func ( Style) () color.Color {
return .getAsColor(borderRightBackgroundKey)
}
func ( Style) () color.Color {
return .getAsColor(borderBottomBackgroundKey)
}
func ( Style) () color.Color {
return .getAsColor(borderLeftBackgroundKey)
}
func ( Style) () int {
return .GetBorderTopSize()
}
func ( Style) () int {
if .isBorderStyleSetWithoutSides() {
return 1
}
if !.getAsBool(borderTopKey, false) {
return 0
}
return .getBorderStyle().GetTopSize()
}
func ( Style) () int {
if .isBorderStyleSetWithoutSides() {
return 1
}
if !.getAsBool(borderLeftKey, false) {
return 0
}
return .getBorderStyle().GetLeftSize()
}
func ( Style) () int {
if .isBorderStyleSetWithoutSides() {
return 1
}
if !.getAsBool(borderBottomKey, false) {
return 0
}
return .getBorderStyle().GetBottomSize()
}
func ( Style) () int {
if .isBorderStyleSetWithoutSides() {
return 1
}
if !.getAsBool(borderRightKey, false) {
return 0
}
return .getBorderStyle().GetRightSize()
}
func ( Style) () int {
return .GetBorderLeftSize() + .GetBorderRightSize()
}
func ( Style) () int {
return .GetBorderTopSize() + .GetBorderBottomSize()
}
func ( Style) () bool {
return .getAsBool(inlineKey, false)
}
func ( Style) () int {
return .getAsInt(maxWidthKey)
}
func ( Style) () int {
return .getAsInt(maxHeightKey)
}
func ( Style) () int {
return .getAsInt(tabWidthKey)
}
func ( Style) () bool {
return .getAsBool(underlineSpacesKey, false)
}
func ( Style) () bool {
return .getAsBool(strikethroughSpacesKey, false)
}
func ( Style) () int {
return .GetHorizontalMargins() + .GetHorizontalPadding() + .GetHorizontalBorderSize()
}
func ( Style) () int {
return .GetVerticalMargins() + .GetVerticalPadding() + .GetVerticalBorderSize()
}
func ( Style) () (, int) {
return .GetHorizontalFrameSize(), .GetVerticalFrameSize()
}
func ( Style) () func(string) string {
return .getAsTransform(transformKey)
}
func ( Style) () (, string) {
if .isSet(linkKey) {
= .link
}
if .isSet(linkParamsKey) {
= .linkParams
}
return
}
func ( Style) ( propKey) bool {
return .props.has()
}
func ( Style) ( propKey) rune {
if !.isSet() {
return 0
}
switch {
case paddingCharKey:
return .paddingChar
case marginCharKey:
return .marginChar
}
return 0
}
func ( Style) ( propKey, bool) bool {
if !.isSet() {
return
}
return .attrs&int64() != 0
}
func ( Style) ( propKey) ( []color.Color) {
if !.isSet() {
return nil
}
switch {
case borderForegroundBlendKey:
return .borderBlendFgColor
}
return nil
}
func ( Style) ( propKey) color.Color {
if !.isSet() {
return noColor
}
var color.Color
switch {
case foregroundKey:
= .fgColor
case backgroundKey:
= .bgColor
case marginBackgroundKey:
= .marginBgColor
case borderTopForegroundKey:
= .borderTopFgColor
case borderRightForegroundKey:
= .borderRightFgColor
case borderBottomForegroundKey:
= .borderBottomFgColor
case borderLeftForegroundKey:
= .borderLeftFgColor
case borderTopBackgroundKey:
= .borderTopBgColor
case borderRightBackgroundKey:
= .borderRightBgColor
case borderBottomBackgroundKey:
= .borderBottomBgColor
case borderLeftBackgroundKey:
= .borderLeftBgColor
case underlineColorKey:
= .ulColor
}
if != nil {
return
}
return noColor
}
func ( Style) ( propKey) int {
if !.isSet() {
return 0
}
switch {
case widthKey:
return .width
case heightKey:
return .height
case paddingTopKey:
return .paddingTop
case paddingRightKey:
return .paddingRight
case paddingBottomKey:
return .paddingBottom
case paddingLeftKey:
return .paddingLeft
case marginTopKey:
return .marginTop
case marginRightKey:
return .marginRight
case marginBottomKey:
return .marginBottom
case marginLeftKey:
return .marginLeft
case borderForegroundBlendOffsetKey:
return .borderForegroundBlendOffset
case maxWidthKey:
return .maxWidth
case maxHeightKey:
return .maxHeight
case tabWidthKey:
return .tabWidth
}
return 0
}
func ( Style) ( propKey) Position {
if !.isSet() {
return Position(0)
}
switch {
case alignHorizontalKey:
return .alignHorizontal
case alignVerticalKey:
return .alignVertical
}
return Position(0)
}
func ( Style) () Border {
if !.isSet(borderStyleKey) {
return noBorder
}
return .borderStyle
}
func ( Style) (propKey) func(string) string {
if !.isSet(transformKey) {
return nil
}
return .transform
}
func ( string) ( []string, int) {
= strings.ReplaceAll(, "\t", " ")
= strings.ReplaceAll(, "\r\n", "\n")
= strings.Split(, "\n")
for , := range {
:= ansi.StringWidth()
if < {
=
}
}
return ,
}
func ( Style) () bool {
var (
= .getBorderStyle()
= .isSet(borderTopKey)
= .isSet(borderRightKey)
= .isSet(borderBottomKey)
= .isSet(borderLeftKey)
)
return != noBorder && !( || || || )
}