コード例 #1
0
ファイル: canvas.go プロジェクト: mishudark/gosexy
// Private: returns wand's hexadecimal color.
func getPixelHexColor(p *C.PixelWand) string {
	var rgb [3]float64

	rgb[0] = float64(C.PixelGetRed(p))
	rgb[1] = float64(C.PixelGetGreen(p))
	rgb[2] = float64(C.PixelGetBlue(p))

	return fmt.Sprintf("#%02x%02x%02x", int(rgb[0]*255.0), int(rgb[1]*255.0), int(rgb[2]*255.0))
}
コード例 #2
0
ファイル: pixel.go プロジェクト: gronpipmaster/canvas
func (self *Pixel) Green() float64 {
	return float64(C.PixelGetGreen(self.wand))
}
コード例 #3
0
ファイル: pixel_wand.go プロジェクト: qwo/abelana-gcp
// Returns the normalized green color of the pixel wand
func (pw *PixelWand) GetGreen() float64 {
	return float64(C.PixelGetGreen(pw.pw))
}