#28714 closed defect (fixed)

clarify docstring of plot.colors.float_to_integer

Reported by: gh-DaveWitteMorris Owned by:
Priority: minor Milestone: sage-9.0
Component: graphics Keywords:
Cc: Merged in:
Authors: Dave Morris Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: b1b1f78 (Commits, GitHub, GitLab) Commit: b1b1f78ff9ed9d13dad7fe2b498a304d0f8ad007
Dependencies: Stopgaps:

Status badges

Description

The docstring of plot.colors.float_to_integer says the output is "an integer with encoding 256^2 r + 256 g + b", but this is incorrect (or misleading, or I was confused, at least) because the formula is not applied until after r, g, and b are converted from real numbers in the interval [0.0, 1.0] to integers in range(256). The same is true of the function Color.__int__, which is a wrapper for float_to_integer.

I will upload a PR to fix the docstrings.

Change History (4)

comment:1 Changed 20 months ago by gh-DaveWitteMorris

  • Branch set to public/28714

comment:2 Changed 20 months ago by gh-DaveWitteMorris

  • Commit set to b1b1f78ff9ed9d13dad7fe2b498a304d0f8ad007
  • Status changed from new to needs_review

New commits:

b1b1f78fix docstring

comment:3 Changed 20 months ago by chapoton

  • Reviewers set to Frédéric Chapoton
  • Status changed from needs_review to positive_review

ok

comment:4 Changed 19 months ago by vbraun

  • Branch changed from public/28714 to b1b1f78ff9ed9d13dad7fe2b498a304d0f8ad007
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.