git-bug/graphql/resolvers/color.go
2019-05-22 20:22:35 +02:00

25 lines
489 B
Go

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