【发布时间】:2021-09-03 13:40:20
【问题描述】:
我正在尝试使用 RGB 为我正在处理的不和谐机器人上的嵌入设置颜色(在 java 中是)并且在弄清楚如何将颜色设置为 #EABE23 或 @ 时遇到了很多麻烦987654322@。我已经尝试了朋友并阅读了文档,但没有找到任何东西,有人知道指向哪个方向吗?
代码:
if (event.getMessageContent().equalsIgnoreCase(prefix + "author")) {
EmbedBuilder author = new EmbedBuilder()
.setTitle(BotName)
.setDescription("Created by: " + Creator)
.setAuthor("All code written and owned by: " + Creator, "https://github.com/me", "")
.setColor(Color.yellow);
event.getChannel().sendMessage(author);
}
【问题讨论】:
-
到目前为止,您是否有任何代码可以让我们看到您是如何尝试设置颜色的?这样会更容易提供帮助。
-
对其进行了编辑,以便您可以看到代码。
-
java.awt.Color 类有一个 Color(float r, float g, float b) 构造函数和一个静态 Color decode(String str)。为什么你不能使用其中之一?