aboutsummaryrefslogblamecommitdiffstats
path: root/graphql/resolvers/color.go
blob: 8dc1309536def0b29a0658eec6512be985a1a461 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                      
                                                                         


                              
                                                                         


                              
                                                                         

                              
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) {
	return int(obj.R), nil
}

func (colorResolver) G(_ context.Context, obj *color.RGBA) (int, error) {
	return int(obj.G), nil
}

func (colorResolver) B(_ context.Context, obj *color.RGBA) (int, error) {
	return int(obj.B), nil
}