Opened 10 years ago

Closed 10 years ago

Last modified 10 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

Description

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/tawindow.py", line 1494, in _buttonrelease_cb

self.button_release(x, y)

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

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

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

self.lc.see()

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

color_index = self.tw.canvas.get_color_index(r, g, b)

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

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

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

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

ZeroDivisionError: float division

Change History (3)

comment:1 Changed 10 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.

http://git.sugarlabs.org/turtleart/mainline/commit/a3fe29531694a36557b816bc690b81e7b231f8ad

comment:2 Changed 10 years ago by tonyforster

or rgb

comment:3 Changed 10 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.