(rgba *gdk.RGBA)
| 68 | } |
| 69 | |
| 70 | func HexFromRGBA(rgba *gdk.RGBA) string { |
| 71 | r := int(math.Round(float64(rgba.Red()) * 255)) |
| 72 | g := int(math.Round(float64(rgba.Green()) * 255)) |
| 73 | b := int(math.Round(float64(rgba.Blue()) * 255)) |
| 74 | |
| 75 | return fmt.Sprintf("#%02X%02X%02X", r, g, b) |
| 76 | } |
| 77 | |
| 78 | // RGBAFromHex assumes the value is correct and ignores alpha |
| 79 | func RGBAFromHex(hex string) (*gdk.RGBA, error) { |
no outgoing calls
no test coverage detected