Skip to content

Commit

Permalink
fix(colors): rename colors that conflict with figura
Browse files Browse the repository at this point in the history
Renames the colors `RED` and `BLUE` to `FIGURA_RED` and `FIGURA_BLUE`. Fixes [a bug](https://discord.com/channels/1129805506354085959/1312362743827009667) reported by @TotalTakeover where vanilla colors would be inaccesible due to Figura colors taking priority.

Co-authored-by: Total <[email protected]>
  • Loading branch information
PoolloverNathan and TotalTakeover committed Nov 30, 2024
1 parent cae56ef commit 759ff96
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void onChange() {
String tooltip = "config.render_debug_parts_pivot.tooltip";
this.tooltip = FiguraText.of(tooltip,
FiguraText.of(tooltip + ".cubes").setStyle(ColorUtils.Colors.AWESOME_BLUE.style),
FiguraText.of(tooltip + ".groups").setStyle(ColorUtils.Colors.BLUE.style));
FiguraText.of(tooltip + ".groups").setStyle(ColorUtils.Colors.FIGURA_BLUE.style));
}};
public static final ConfigType.BoolConfig
ALLOW_FP_HANDS = new ConfigType.BoolConfig("allow_fp_hands", RENDERING, false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ private static Style getTypeColor(LuaValue value) {
if (value.istable())
return ColorUtils.Colors.AWESOME_BLUE.style;
else if (!(value instanceof LuaString) && value.isnumber())
return ColorUtils.Colors.BLUE.style;
return ColorUtils.Colors.FIGURA_BLUE.style;
else if (value.isnil())
return ColorUtils.Colors.LUA_ERROR.style;
else if (value.isboolean())
Expand Down
24 changes: 12 additions & 12 deletions common/src/main/java/org/figuramc/figura/lua/docs/FiguraDoc.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public JsonObject toJson(boolean translate) {
public static int printRoot() {
FiguraMod.sendChatMessage(HEADER.copy()
.append("\n\n")
.append(FiguraText.of("docs").withStyle(ColorUtils.Colors.BLUE.style)));
.append(FiguraText.of("docs").withStyle(ColorUtils.Colors.FIGURA_BLUE.style)));

return 1;
}
Expand Down Expand Up @@ -134,7 +134,7 @@ public int print() {

// type
message.append("\n\t")
.append(Component.literal("• " + name).withStyle(ColorUtils.Colors.BLUE.style));
.append(Component.literal("• " + name).withStyle(ColorUtils.Colors.FIGURA_BLUE.style));

if (superclass != null) {
message.append(" (")
Expand All @@ -151,7 +151,7 @@ public int print() {
.append(":")
.withStyle(ColorUtils.Colors.PURPLE.style));

MutableComponent descText = Component.empty().withStyle(ColorUtils.Colors.BLUE.style);
MutableComponent descText = Component.empty().withStyle(ColorUtils.Colors.FIGURA_BLUE.style);
for (Component component : TextUtils.splitText(FiguraText.of("docs." + description), "\n"))
descText.append("\n\t").append("• ").append(component);
message.append(descText);
Expand Down Expand Up @@ -242,7 +242,7 @@ public int print() {
.append(":")
.withStyle(ColorUtils.Colors.PURPLE.style))
.append("\n\t")
.append(Component.literal("• " + name).withStyle(ColorUtils.Colors.BLUE.style));
.append(Component.literal("• " + name).withStyle(ColorUtils.Colors.FIGURA_BLUE.style));

// aliases
if (aliases.length > 0) {
Expand All @@ -256,7 +256,7 @@ public int print() {
message.append("\n\t")
.append(Component.literal("• ")
.append(alias)
.withStyle(ColorUtils.Colors.BLUE.style));
.withStyle(ColorUtils.Colors.FIGURA_BLUE.style));
}
}

Expand All @@ -271,10 +271,10 @@ public int print() {

// name
message.append("\n\t")
.append(Component.literal("• ").withStyle(ColorUtils.Colors.BLUE.style))
.append(Component.literal("• ").withStyle(ColorUtils.Colors.FIGURA_BLUE.style))
.append(Component.literal("<" + typeName + ">").withStyle(ChatFormatting.YELLOW))
.append(Component.literal(isStatic ? "." : ":").withStyle(ChatFormatting.BOLD))
.append(Component.literal(name).withStyle(ColorUtils.Colors.BLUE.style))
.append(Component.literal(name).withStyle(ColorUtils.Colors.FIGURA_BLUE.style))
.append("(");

for (int j = 0; j < parameterTypes[i].length; j++) {
Expand All @@ -289,7 +289,7 @@ public int print() {

// return
message.append(") → ")
.append(FiguraText.of("docs.text.returns").append(" ").withStyle(ColorUtils.Colors.BLUE.style))
.append(FiguraText.of("docs.text.returns").append(" ").withStyle(ColorUtils.Colors.FIGURA_BLUE.style))
.append(FiguraDocsManager.getClassText(returnTypes[i]).withStyle(ChatFormatting.YELLOW));
}

Expand All @@ -300,7 +300,7 @@ public int print() {
.append(":")
.withStyle(ColorUtils.Colors.PURPLE.style));

MutableComponent descText = Component.empty().withStyle(ColorUtils.Colors.BLUE.style);
MutableComponent descText = Component.empty().withStyle(ColorUtils.Colors.FIGURA_BLUE.style);
for (Component component : TextUtils.splitText(FiguraText.of("docs." + description), "\n"))
descText.append("\n\t").append("• ").append(component);
message.append(descText);
Expand Down Expand Up @@ -386,9 +386,9 @@ public int print() {
.append(":")
.withStyle(ColorUtils.Colors.PURPLE.style))
.append("\n\t")
.append(Component.literal("• ").withStyle(ColorUtils.Colors.BLUE.style))
.append(Component.literal("• ").withStyle(ColorUtils.Colors.FIGURA_BLUE.style))
.append(FiguraDocsManager.getClassText(type).withStyle(ChatFormatting.YELLOW))
.append(Component.literal(" " + name).withStyle(ColorUtils.Colors.BLUE.style))
.append(Component.literal(" " + name).withStyle(ColorUtils.Colors.FIGURA_BLUE.style))
.append(Component.literal(" (")
.append(FiguraText.of(editable ? "docs.text.editable" : "docs.text.not_editable"))
.append(")")
Expand All @@ -401,7 +401,7 @@ public int print() {
.append(":")
.withStyle(ColorUtils.Colors.PURPLE.style));

MutableComponent descText = Component.empty().withStyle(ColorUtils.Colors.BLUE.style);
MutableComponent descText = Component.empty().withStyle(ColorUtils.Colors.FIGURA_BLUE.style);
for (Component component : TextUtils.splitText(FiguraText.of("docs." + description), "\n"))
descText.append("\n\t").append("• ").append(component);
message.append(descText);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private LiteralArgumentBuilder<FiguraClientCommandSource> generateCommand() {
.append("\n\t")
.append(Component.literal("• ")
.append(FiguraText.of("docs.enum." + id))
.withStyle(ColorUtils.Colors.BLUE.style))
.withStyle(ColorUtils.Colors.FIGURA_BLUE.style))
.append("\n\n")
.append(Component.literal("• ")
.append(FiguraText.of("docs.text.entries"))
Expand Down Expand Up @@ -283,7 +283,7 @@ public static LiteralArgumentBuilder<FiguraClientCommandSource> getCommand() {
.append("\n\t")
.append(Component.literal("• ")
.append(Component.literal("enumerators"))
.withStyle(ColorUtils.Colors.BLUE.style))
.withStyle(ColorUtils.Colors.FIGURA_BLUE.style))

.append("\n\n")
.append(Component.literal("• ")
Expand All @@ -293,7 +293,7 @@ public static LiteralArgumentBuilder<FiguraClientCommandSource> getCommand() {
.append("\n\t")
.append(Component.literal("• ")
.append(FiguraText.of("docs.enum"))
.withStyle(ColorUtils.Colors.BLUE.style))
.withStyle(ColorUtils.Colors.FIGURA_BLUE.style))
);
return 1;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ else if (updateLight && (l = Minecraft.getInstance().level) != null) {

protected void renderPivot(FiguraModelPart part, PartCustomization customization) {
boolean group = part.customization.partType == PartCustomization.PartType.GROUP;
FiguraVec3 color = group ? ColorUtils.Colors.BLUE.vec : ColorUtils.Colors.AWESOME_BLUE.vec;
FiguraVec3 color = group ? ColorUtils.Colors.FIGURA_BLUE.vec : ColorUtils.Colors.AWESOME_BLUE.vec;
double boxSize = group ? 1 / 16d : 1 / 32d;
boxSize /= Math.max(Math.cbrt(part.savedPartToWorldMat.det()), 0.02);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public class ColorUtils {
public enum Colors {
AWESOME_BLUE(0x5EA5FF),
PURPLE(0xA672EF),
BLUE(0x00F0FF),
FIGURA_BLUE(0x00F0FF),
SOFT_BLUE(0x99BBEE),
RED(0xFF2400),
FIGURA_RED(0xFF2400),
ORANGE(0xFFC400),

CHEESE(0xF8C53A),
Expand Down

0 comments on commit 759ff96

Please sign in to comment.