Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#2545 closed defect (fixed)

colour, shade, grey, turtle sees

Reported by: tonyforster Owned by: walter
Priority: Unspecified by Maintainer Milestone: Unspecified
Component: Turtleart Version: Unspecified
Severity: Unspecified Keywords:
Cc: Distribution/OS: Unspecified
Bug Status: Resolved


messing with turtle sees, the mouse would not release the turtle, log shows /0 error

Also, turtle sees is affected by the shade setting, even though what it is seeing was done at default shade.

Traceback (most recent call last):

File "/home/olpc/Activities/TurtleArt.activity/TurtleArt/", line 1494, in _buttonrelease_cb

self.button_release(x, y)

File "/home/olpc/Activities/TurtleArt.activity/TurtleArt/", line 1518, in button_release

self.active_turtle.spr.rect.height / 2)

File "/home/olpc/Activities/TurtleArt.activity/TurtleArt/", line 1571, in _move_turtle

File "/home/olpc/Activities/TurtleArt.activity/TurtleArt/", line 1455, in see

color_index =, g, b)

File "/home/olpc/Activities/TurtleArt.activity/TurtleArt/", line 596, in get_color_index

r = calc_gray(r, self.gray, True)

File "/home/olpc/Activities/TurtleArt.activity/TurtleArt/", line 64, in calc_gray

return int(((c * 100) - (32768 * (100 - g))) / g)

ZeroDivisionError: float division

Change History (3)

comment:1 Changed 13 years ago by walter

  • Bug Status changed from Unconfirmed to Resolved
  • Resolution set to fixed
  • Status changed from new to closed

Ooops. This patch is a work-around. Ultimately, we need a more robust, invertible color model. Perhaps it is time for CIE Lab.

comment:2 Changed 13 years ago by tonyforster

or rgb

comment:3 Changed 13 years ago by walter

The problem with RGB is that is doesn't know about the concept of hue.

Note: See TracTickets for help on using tickets.