Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rule ¶
type Rule interface { Size() int Matches(color.Color) bool Colorize(x, y int) color.Color String() string }
Rule defines a generic interface for rules
type RuleFromPNGFile ¶
type RuleFromPNGFile struct {
// contains filtered or unexported fields
}
RuleFromPNGFile reads rules from SVG files
func NewRuleFromPNGFile ¶
func NewRuleFromPNGFile(path string) (*RuleFromPNGFile, error)
NewRuleFromPNGFile creates a new Rule
func (*RuleFromPNGFile) Colorize ¶
func (r *RuleFromPNGFile) Colorize(x, y int) color.Color
Colorize returns the replacement color at a given position where x and y are between 0 and Size() inclusively
func (*RuleFromPNGFile) Matches ¶
func (r *RuleFromPNGFile) Matches(c color.Color) bool
Matches returns whether this rule is responsible for the given color (Chain-of-responsibility pattern)
func (*RuleFromPNGFile) Size ¶
func (r *RuleFromPNGFile) Size() int
Size returns the width (= height) of the replaced colors
func (*RuleFromPNGFile) String ¶
func (r *RuleFromPNGFile) String() string
String gives a human-readable representation of this Rule
Click to show internal directories.
Click to hide internal directories.