Added direct link to GoDoc and specified a range of values for the colour button inputs and outputs
This commit is contained in:
parent
867a9e5a49
commit
5b52463b74
|
@ -30,7 +30,7 @@ should suffice.
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
|
|
||||||
The in-code documentation is sufficient to get started, but needs improvement.
|
The in-code documentation is sufficient to get started, but needs improvement. The GoDoc documentation can be found [here](https://godoc.org/github.com/andlabs/ui).
|
||||||
|
|
||||||
Some simple example programs are in the `examples` directory. You can `go build` each of them individually.
|
Some simple example programs are in the `examples` directory. You can `go build` each of them individually.
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ func NewColorButton() *ColorButton {
|
||||||
|
|
||||||
// Color returns the color currently selected in the ColorButton.
|
// Color returns the color currently selected in the ColorButton.
|
||||||
// Colors are not alpha-premultiplied.
|
// Colors are not alpha-premultiplied.
|
||||||
|
// The output values are between 0 and 1, they map to between 0 and 255. E.g. 1 --> 255, 0.2 --> 51
|
||||||
// TODO rename b or bl
|
// TODO rename b or bl
|
||||||
func (b *ColorButton) Color() (r, g, bl, a float64) {
|
func (b *ColorButton) Color() (r, g, bl, a float64) {
|
||||||
c := C.pkguiAllocColorDoubles()
|
c := C.pkguiAllocColorDoubles()
|
||||||
|
@ -41,6 +42,7 @@ func (b *ColorButton) Color() (r, g, bl, a float64) {
|
||||||
|
|
||||||
// SetColor sets the currently selected color in the ColorButton.
|
// SetColor sets the currently selected color in the ColorButton.
|
||||||
// Colors are not alpha-premultiplied.
|
// Colors are not alpha-premultiplied.
|
||||||
|
// The input values are between 0 and 1, they map to between 0 and 255. E.g. 1 --> 255, 0.2 --> 51
|
||||||
// TODO rename b or bl
|
// TODO rename b or bl
|
||||||
func (b *ColorButton) SetColor(r, g, bl, a float64) {
|
func (b *ColorButton) SetColor(r, g, bl, a float64) {
|
||||||
C.uiColorButtonSetColor(b.b, C.double(r), C.double(g), C.double(bl), C.double(a))
|
C.uiColorButtonSetColor(b.b, C.double(r), C.double(g), C.double(bl), C.double(a))
|
||||||
|
|
Loading…
Reference in New Issue