hue hue hue
This commit is contained in:
@@ -9,9 +9,10 @@ const eps = 0.0001
|
||||
const epsSquare = eps * eps
|
||||
|
||||
type Gamut struct {
|
||||
Red XY `json:"red"`
|
||||
Green XY `json:"green"`
|
||||
Blue XY `json:"blue"`
|
||||
Label string `json:"label,omitempty"`
|
||||
Red XY `json:"red"`
|
||||
Green XY `json:"green"`
|
||||
Blue XY `json:"blue"`
|
||||
}
|
||||
|
||||
func (cg *Gamut) side(x1, y1, x2, y2, x, y float64) float64 {
|
||||
@@ -171,7 +172,8 @@ func (xy XY) ToHS() HueSat {
|
||||
}
|
||||
|
||||
func (xy XY) DistanceTo(other XY) float64 {
|
||||
return math.Sqrt(math.Pow(xy.X-other.X, 2) + math.Pow(xy.Y-other.Y, 2))
|
||||
return math.Abs(xy.X-other.X) + math.Abs(xy.Y-other.Y)
|
||||
//return math.Sqrt(math.Pow(xy.X-other.X, 2) + math.Pow(xy.Y-other.Y, 2))
|
||||
}
|
||||
|
||||
func (xy XY) Round() XY {
|
||||
|
||||
Reference in New Issue
Block a user