Skip to content

Commit

Permalink
feat: BorderForeground method
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Aug 1, 2022
1 parent 560d1ef commit c3d2d04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Expand Up @@ -63,7 +63,12 @@ func SetColorValue(fieldPtr, keyPtr, valuePtr *C.char, adaptive bool) {

if adaptive {
adaptiveColor := lipgloss.AdaptiveColor{}
json.Unmarshal([]byte(str(valuePtr)), &adaptiveColor)
err := json.Unmarshal([]byte(str(valuePtr)), &adaptiveColor)

if err != nil {
panic("Unable to parse color")
}

color := reflect.ValueOf(adaptiveColor)
reflect.ValueOf(style).MethodByName(key).Call([]reflect.Value{color})
} else {
Expand Down
4 changes: 4 additions & 0 deletions src/lib.ts
Expand Up @@ -171,6 +171,10 @@ export class Style {
return this.SetBooleanValue('BorderRight', val)
}

BorderForeground(color: BlipglossColor) {
return this.SetColorValue('BorderForeground', color)
}

BorderBackground(color: BlipglossColor) {
return this.SetColorValue('BorderBackground', color)
}
Expand Down

0 comments on commit c3d2d04

Please sign in to comment.