Esempio n. 1
0
// 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))
}
Esempio n. 2
0
func (self *Pixel) Red() float64 {
	return float64(C.PixelGetRed(self.wand))
}
Esempio n. 3
0
// Returns the normalized red color of the pixel wand
func (pw *PixelWand) GetRed() float64 {
	return float64(C.PixelGetRed(pw.pw))
}