git-bug/graphql/resolvers/color.go

25 lines
483 B
Go
Raw Normal View History

2019-04-10 22:50:03 +03:00
package resolvers
import (
"context"
"image/color"
"github.com/MichaelMure/git-bug/graphql/graph"
)
var _ graph.ColorResolver = &colorResolver{}
type colorResolver struct{}
func (colorResolver) R(_ context.Context, obj *color.RGBA) (int, error) {
2019-04-10 22:50:03 +03:00
return int(obj.R), nil
}
func (colorResolver) G(_ context.Context, obj *color.RGBA) (int, error) {
2019-04-10 22:50:03 +03:00
return int(obj.G), nil
}
func (colorResolver) B(_ context.Context, obj *color.RGBA) (int, error) {
2019-04-10 22:50:03 +03:00
return int(obj.B), nil
}