racket / racket/gui

Deprecate/remove `is-color-display?`

Open
#327 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
68
Forks
82
PR merge metrics
No merged PRs in 30d

Description

The function is-color-display? is useless, in its current form, and I propose that it be deprecated and/or removed.

  • It has separate implementations in all 3 backends (gtk3, cocoa, win32) and all of them simply hardcode a constant: (define (is-color-display?) #t)
  • Modern GUI toolkits don't seem to have a corresponding function for it to easily wrap (perhaps because nearly every display in use today has color), so there's no obvious and simple path to fixing it -- nor does there seem to be any great demand for this functionality
  • Unlike most other per-monitor attributes which have racket/gui accessors, this one doesn't take a #:monitor argument (so you can't answer questions like: "Am I drawing on a monochrome monitor right now?")
  • There's no corresponding event that I can find, so when monitors or settings change, your program won't know (unless you poll, which brings its own set of problems)
  • No Racket program that I've found uses this function, and nobody has ever mentioned that it doesn't do what it claims to do

Even if all the issues here were fixed, it's not clear what its intended use is. Perhaps a program could use this as a hint to distinguish visuals by shape rather than simply color, but given the prevalence of colorblindness, they should always do that, anyway.

The one place where I can imagine such a feature being useful is for printing, as black-and-white printers are still fairly common, but that obviously goes through printer-dc% and dc<%>, not the default monitor, and those interfaces have no such feature, so it can't be used for that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the is-color-display? implementations in the gtk3, cocoa, and win32 backends, along with the public GUI API references. Decide the deprecation or removal scope, then verify that all three backends and the exposed API consistently reflect that decision.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.