diff --git a/plugins/builtin/source/content/data_inspector.cpp b/plugins/builtin/source/content/data_inspector.cpp index e2ba30b28..4f525e313 100644 --- a/plugins/builtin/source/content/data_inspector.cpp +++ b/plugins/builtin/source/content/data_inspector.cpp @@ -539,6 +539,20 @@ namespace hex::plugin::builtin { return copyValue; }; }); + + ContentRegistry::DataInspector::add("hex.builtin.inspector.rgb565", sizeof(u16), [](auto buffer, auto endian, auto style) { + hex::unused(style); + + auto value = hex::changeEndianess(*reinterpret_cast(buffer.data()), endian); + ImColor color((value & 0x1F) << 3, ((value >> 5) & 0x3F) << 2, ((value >> 11) & 0x1F) << 3, 0xFF); + + auto copyValue = hex::format("#{:02X}{:02X}{:02X}", u8(0xFF * (color.Value.x)), u8(0xFF * (color.Value.y)), u8(0xFF * (color.Value.z)), 0xFF); + + return [color, copyValue] { + ImGui::ColorButton("##inspectorColor", color, ImGuiColorEditFlags_None, ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetTextLineHeight())); + return copyValue; + }; + }); } // clang-format on diff --git a/plugins/builtin/source/lang/de_DE.cpp b/plugins/builtin/source/lang/de_DE.cpp index 9e0e4743d..01b9203eb 100644 --- a/plugins/builtin/source/lang/de_DE.cpp +++ b/plugins/builtin/source/lang/de_DE.cpp @@ -440,6 +440,7 @@ namespace hex::plugin::builtin { { "hex.builtin.inspector.dos_time", "DOS Time" }, { "hex.builtin.inspector.guid", "GUID" }, { "hex.builtin.inspector.rgba8", "RGBA8 Farbe" }, + { "hex.builtin.inspector.rgb565", "RGB565 Farbe" }, { "hex.builtin.nodes.common.input", "Input" }, { "hex.builtin.nodes.common.input.a", "Input A" }, diff --git a/plugins/builtin/source/lang/en_US.cpp b/plugins/builtin/source/lang/en_US.cpp index 67f5b9911..11bae4665 100644 --- a/plugins/builtin/source/lang/en_US.cpp +++ b/plugins/builtin/source/lang/en_US.cpp @@ -444,7 +444,8 @@ namespace hex::plugin::builtin { { "hex.builtin.inspector.dos_date", "DOS Date" }, { "hex.builtin.inspector.dos_time", "DOS Time" }, { "hex.builtin.inspector.guid", "GUID" }, - { "hex.builtin.inspector.rgba8", "RGBA8 color" }, + { "hex.builtin.inspector.rgba8", "RGBA8 Color" }, + { "hex.builtin.inspector.rgb565", "RGB565 Color" }, { "hex.builtin.nodes.common.input", "Input" }, { "hex.builtin.nodes.common.input.a", "Input A" }, diff --git a/plugins/builtin/source/lang/it_IT.cpp b/plugins/builtin/source/lang/it_IT.cpp index 29a32b8f5..79394bbaa 100644 --- a/plugins/builtin/source/lang/it_IT.cpp +++ b/plugins/builtin/source/lang/it_IT.cpp @@ -443,6 +443,7 @@ namespace hex::plugin::builtin { //{ "hex.builtin.inspector.dos_time", "DOS Time" }, { "hex.builtin.inspector.guid", "GUID" }, { "hex.builtin.inspector.rgba8", "Colori RGBA8" }, + { "hex.builtin.inspector.rgb565", "Colori RGB565" }, { "hex.builtin.nodes.constants", "Costanti" }, { "hex.builtin.nodes.constants.int", "Intero" }, diff --git a/plugins/builtin/source/lang/ja_JP.cpp b/plugins/builtin/source/lang/ja_JP.cpp index b15b135a5..9c7204f16 100644 --- a/plugins/builtin/source/lang/ja_JP.cpp +++ b/plugins/builtin/source/lang/ja_JP.cpp @@ -443,7 +443,8 @@ namespace hex::plugin::builtin { //{ "hex.builtin.inspector.dos_date", "DOS Date" }, //{ "hex.builtin.inspector.dos_time", "DOS Time" }, { "hex.builtin.inspector.guid", "GUID" }, - { "hex.builtin.inspector.rgba8", "RGBA8 color" }, + { "hex.builtin.inspector.rgba8", "RGBA8 Color" }, + { "hex.builtin.inspector.rgb565", "RGB565 Color" }, { "hex.builtin.nodes.common.input", "入力" }, { "hex.builtin.nodes.common.input.a", "入力 A" }, diff --git a/plugins/builtin/source/lang/pt_BR.cpp b/plugins/builtin/source/lang/pt_BR.cpp index ec84bffa0..3886af6c3 100644 --- a/plugins/builtin/source/lang/pt_BR.cpp +++ b/plugins/builtin/source/lang/pt_BR.cpp @@ -440,7 +440,8 @@ namespace hex::plugin::builtin { { "hex.builtin.inspector.dos_date", "DOS Date" }, { "hex.builtin.inspector.dos_time", "DOS Time" }, { "hex.builtin.inspector.guid", "GUID" }, - { "hex.builtin.inspector.rgba8", "RGBA8 color" }, + { "hex.builtin.inspector.rgba8", "RGBA8 Color" }, + { "hex.builtin.inspector.rgb565", "RGB565 Color" }, { "hex.builtin.nodes.common.input", "Input" }, { "hex.builtin.nodes.common.input.a", "Input A" }, diff --git a/plugins/builtin/source/lang/zh_CN.cpp b/plugins/builtin/source/lang/zh_CN.cpp index 8325713bd..fad37fbcc 100644 --- a/plugins/builtin/source/lang/zh_CN.cpp +++ b/plugins/builtin/source/lang/zh_CN.cpp @@ -445,6 +445,7 @@ namespace hex::plugin::builtin { { "hex.builtin.inspector.dos_time", "DOS 时间" }, { "hex.builtin.inspector.guid", "GUID" }, { "hex.builtin.inspector.rgba8", "RGBA8 颜色" }, + { "hex.builtin.inspector.rgb565", "RGB565 颜色" }, { "hex.builtin.nodes.common.input", "输入" }, { "hex.builtin.nodes.common.input.a", "输入 A" }, diff --git a/plugins/builtin/source/lang/zh_TW.cpp b/plugins/builtin/source/lang/zh_TW.cpp index afe7a9552..51ac2ddb6 100644 --- a/plugins/builtin/source/lang/zh_TW.cpp +++ b/plugins/builtin/source/lang/zh_TW.cpp @@ -442,6 +442,7 @@ namespace hex::plugin::builtin { { "hex.builtin.inspector.dos_time", "DOS 時間" }, { "hex.builtin.inspector.guid", "GUID" }, { "hex.builtin.inspector.rgba8", "RGBA8 顏色" }, + { "hex.builtin.inspector.rgb565", "RGB565 顏色" }, { "hex.builtin.nodes.common.input", "輸入" }, { "hex.builtin.nodes.common.input.a", "輸入 A" },