golang-ui / nuklear

This project provides Go bindings for nuklear.h — a small ANSI C GUI library.
https://github.com/vurtun/nuklear
MIT License
1.57k stars 98 forks source link

Change text color #53

Open jkvatne opened 6 years ago

jkvatne commented 6 years ago

I need to change the text color. The following function does it, but it has to be placed in etc.go, because the fields are not public. `The push/pop functions have the same problem. Is there a better way to do it, or could this routine be included in the library?


func SetTextColor(ctx *Context, color Color) {
    var style *Style
    style = ctx.Style()
    text := &style.text
    text.color.r = color.r
    text.color.g = color.g
    text.color.b = color.b
}
``
xlab commented 6 years ago

@jkvatne there is a lot of cases of that, I think we need to place everything in etc. The design of Nuklear is that there is a lot of private field manipulation involved.