Skip to content

Commit

Permalink
ColorManager: Fix encoder for colors
Browse files Browse the repository at this point in the history
It's not used, but it's good to have a proper one in any case.
  • Loading branch information
Juuxel committed Aug 6, 2024
1 parent b56ae6d commit 797de00
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public record ColorPair(int bg, int fg) {
private static final int DEFAULT_FG = Colors.SCREEN_TEXT;

private static final Codec<Integer> COLOR_CODEC =
Codec.STRING.comapFlatMap(ColorManager::parseHexColor, color -> HexFormat.of().withUpperCase().toHexDigits(color));
Codec.STRING.comapFlatMap(ColorManager::parseHexColor, color -> '#' + HexFormat.of().withUpperCase().toHexDigits(color));
public static final Codec<ColorPair> CODEC = Codecs.alternatively(
RecordCodecBuilder.create(instance -> instance.group(
COLOR_CODEC.fieldOf("bg").forGetter(ColorPair::bg),
Expand Down

0 comments on commit 797de00

Please sign in to comment.