Skip to content

Incorrect colors when loading a 16-color ANSI file while switching from initial 256-color mode #142

Open

Description

@cmang

1: Start Durdraw in 256 color mode.
2: Load a 16-color ANSI file. Durdraw switches to 16 color mode and loads the file. Some colors are wrong.
3: Re-load the 16-color ANSI file (or load another 16 color ANSI file). Colors are correct.

This problem does not occur when loading a 16-color .dur file. It does not occur when started in 16-color mode.

If you switch from 16 color mode to 256 color, and then load the 16-color ANSI file, it loads correctly and the problem does not occur.

It does occur if you pass a 16-color ANSI file to the command line (causing it to instantly start in 256 color mode, then switch to 16 color mode).

Copilot thinks this is related to "default_fg_color = appState.defaultFgColor " in durdraw/durdraw_ansiparse.py under def parse_ansi_escape_codes(). Bright white foreground gets changed to bright yellow. Non-bright white gets changed to non-bright yellow/brown. This happens when the background is white/gray, or black. Not when it's bright white on another background. Seems inconsistent.

Examples:

Image Image Image Image

Affects both Master/release and Dev branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions