256 colors palette #479

Closed
opened 6 months ago by cglogic · 1 comments
cglogic commented 6 months ago

It looks like foot uses darker 256 palette colors. I worked arount this by updating the palette on shell start and after a command executed.

I rewrote this perl code into zsh to load the palette:

# colors 16-231 are a 6x6x6 color cube
for ($red = 0; $red < 6; $red++) {
   for ($green = 0; $green < 6; $green++) {
      for ($blue = 0; $blue < 6; $blue++) {
          printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
                 16 + ($red * 36) + ($green * 6) + $blue,
                 ($red ? ($red * 40 + 55) : 0),
                 ($green ? ($green * 40 + 55) : 0),
                 ($blue ? ($blue * 40 + 55) : 0));
      }
   }
}

# colors 232-255 are a grayscale ramp, intentionally leaving out
# black and white
for ($gray = 0; $gray < 24; $gray++) {
    $level = ($gray * 10) + 8;
    printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\",
         232 + $gray, $level, $level, $level);
}

But in some cases it can't be fixed by this way. If run foot tmux or when nnn opens file for editing it resets the palette to default after editing is finished.

Is it(foot's default palette colors difference) intended?

It looks like foot uses darker 256 palette colors. I worked arount this by updating the palette on shell start and after a command executed. I rewrote this perl code into zsh to load the palette: ``` # colors 16-231 are a 6x6x6 color cube for ($red = 0; $red < 6; $red++) { for ($green = 0; $green < 6; $green++) { for ($blue = 0; $blue < 6; $blue++) { printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\", 16 + ($red * 36) + ($green * 6) + $blue, ($red ? ($red * 40 + 55) : 0), ($green ? ($green * 40 + 55) : 0), ($blue ? ($blue * 40 + 55) : 0)); } } } # colors 232-255 are a grayscale ramp, intentionally leaving out # black and white for ($gray = 0; $gray < 24; $gray++) { $level = ($gray * 10) + 8; printf("\x1b]4;%d;rgb:%2.2x/%2.2x/%2.2x\x1b\\", 232 + $gray, $level, $level, $level); } ``` But in some cases it can't be fixed by this way. If run `foot tmux` or when `nnn` opens file for editing it resets the palette to default after editing is finished. Is it(foot's default palette colors difference) intended?
Owner

Is it(foot's default palette colors difference) intended?

Nope, it's a bug :)

> Is it(foot's default palette colors difference) intended? Nope, it's a bug :)
dnkl added the
bug
label 6 months ago
dnkl referenced this issue from a commit 6 months ago
dnkl closed this issue 6 months ago
dnkl referenced this issue from a commit 6 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.