golang-ui / nuklear

This project provides Go bindings for nuklear.h — a small ANSI C GUI library.

Home Page:https://github.com/vurtun/nuklear

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change text color

jkvatne opened this issue · comments

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
}
``

@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.