Как изменить цвет imgui lua

Как изменить цвет отдельной кнопки Button в imgui.

AnWu


  • #3

imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(1.00, 1.00, 1.00, 0.65))

imgui.Button("Тест")

imgui.PopStyleColor(1)

Вот так?

Albertio

Attention! Thanks for your attention.


  • #4

imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(1.00, 1.00, 1.00, 0.65))

imgui.Button("Тест")

imgui.PopStyleColor(1)

Вот так?

Да только в скобках 1 не надо

Vintik

Vintik

А голова чтобы думать, ноги чтобы ходить


  • #5

Да только в скобках 1 не надо

а как сделать цвет активной (выделенной) кнопки и цвет при нажатии

  • #6

а как сделать цвет активной (выделенной) кнопки и цвет при нажатии

???????

Vintik

Vintik

А голова чтобы думать, ноги чтобы ходить


  • #9

imgui.PushStyleColor(imgui.Col.ButtonHovered, imgui.ImVec4(0.25, 0.25, 0.26, 0.0))
imgui.PushStyleColor(imgui.Col.ButtonActive, imgui.ImVec4(0.25, 0.25, 0.26, 0.0))
imgui.Button(...)
imgui.PopStyleColor(2)

Change color within text / colored text

I have enhanced the ImGui::TextUnformated() method to make it support arbitrary text color, underline, strikethrough, highlight, mask

I aslo add one demo for this feature.

image

The code for the demo is shown below.

The new TextUnformatted signature was changed to support this feature. The wrapped, disabled, and customization are newly added args with default values. So it should be compatible with existing code.

IMGUI_API void TextUnformatted(const char* text, const char* text_end = NULL, bool wrapped = false, bool disabled = false, const ImTextCustomization *customization = NULL);

       IMGUI_DEMO_MARKER("Widgets/Text/Text Customization");
        if (ImGui::TreeNode("Text Customization Simple"))
        {
            ImColor red(255, 0, 0, 255);
            ImColor green(0, 255, 0, 255);
            ImColor blue(0, 0, 255, 255);
            ImColor yellow(255, 255, 0, 255); 
            ImColor brown(187, 126, 0, 255);
            ImColor cyan(0, 255, 255, 255);
            ImColor magenta(255, 0, 255, 125);

            const char* text = "The quick red fox jumps over the green box.";
            ImTextCustomization tc;

            ImGui::NewLine();
            ImGui::Text("Color the whole text");            
            ImGui::TextUnformatted(text, NULL, true, false, &tc.Range(text).TextColor(green));

            ImGui::NewLine();
            ImGui::Text("Color the sustring of the text");
            ImGui::TextUnformatted(text, NULL, true, false, &tc.Clear().Range(text + 14, text + 17).TextColor(red).Range(text + 39, text + 42).TextColor(green));

            ImGui::NewLine();
            ImGui::Text("Underline");
            ImGui::TextUnformatted(text, NULL, true, false, &tc.Clear().Range(text).Unerline());

            ImGui::NewLine();
            ImGui::Text("Underline with color");
            ImGui::TextUnformatted(text, NULL, true, false, &tc.Clear().Range(text).Unerline(blue));

            ImGui::NewLine();
            ImGui::Text("Strikethrough");
            ImGui::TextUnformatted(text, NULL, true, false, &tc.Clear().Range(text).Strkethrough());

            ImGui::NewLine();
            ImGui::Text("Strikethrough with color");
            ImGui::TextUnformatted(text, NULL, true, false, &tc.Clear().Range(text).Strkethrough(red));

            ImGui::NewLine();
            ImGui::Text("Hilight the text with brown");
            ImGui::TextUnformatted(text, NULL, true, false, &tc.Clear().Range(text).Highlight(brown));

            ImGui::NewLine();
            ImGui::Text("Mask the text so it is not readable");
            ImGui::TextUnformatted(text, NULL, true, false, &tc.Clear().Range(text+10, text+17).Mask());

            ImGui::NewLine();
            ImGui::Text("Mask the text with color");
            ImGui::TextUnformatted(text, NULL, true, false, &tc.Clear().Range(text+10, text+17).Mask(cyan));

            ImGui::NewLine();
            ImGui::Text("Mask the text with semitransparent color");
            ImGui::TextUnformatted(text, NULL, true, false, &tc.Clear().Range(text+10, text+28).Mask(magenta));
            ImGui::NewLine();

            ImGui::TreePop();
        }

Those text styles are all with a text and can be combined as needed.

Here is another demo. It allows the user to adjust the ranges to apply a style and see the result.

image

The code is on Text Customization Branch

Any comments please let me know.

If it is possible I will create a pull request when ready. Thanks.

Darwin

Darwin

Команда форума

Администратор

Сообщения
815
Реакции
404


  • #1

Настройка параметров стиля в ImGui​

Если вы хотите изменить стиль ImGui меню не знаете какие параметры за что отвечают, решил перевести для вас параметры стилей ImGui через которые вы можете изменить помните то цвет в ImGui изменяется через float, соответственно максимальное значение 1.f знайте это

Как найти значение цвета rgb в типе данных float можно посмотреть тут:

Последнее редактирование: 11.05.2022

  • #2

Я только что смотрел твое видео где ты показывал как сделал свой стиль xD

ratmorra

ratmorra

Onion

Сообщения
306
Реакции
259


  • #14

jklhgjsdfsghjadsqewrtyuoip[]

  • #15

jlkdsfsgdafdasjkldfasjkladfjslk

Go Back   UnKnoWnCheaTs — Multiplayer Game Hacking and Cheats

  • Anti-Cheat Software & Programming


  • General Programming and Reversing

  • Reload this Page

    [Tutorial] ImGui theme color

    ImGui theme color
    ImGui theme color

    Save

    Authenticator Code

    Reply

    Thread Tools

    ImGui theme color

    Old
    25th March 2018, 10:21 AM

     
    #1

    greatR

    A God

    greatR's Avatar

    Join Date: Mar 2018


    Posts: 183

    Reputation: 3384

    Rep Power: 123

    greatR is a legend in the cheating communitygreatR is a legend in the cheating communitygreatR is a legend in the cheating communitygreatR is a legend in the cheating communitygreatR is a legend in the cheating communitygreatR is a legend in the cheating communitygreatR is a legend in the cheating communitygreatR is a legend in the cheating communitygreatR is a legend in the cheating communitygreatR is a legend in the cheating communitygreatR is a legend in the cheating community

    Points: 8,612, Level: 10

    Points: 8,612, Level: 10 Points: 8,612, Level: 10 Points: 8,612, Level: 10

    Level up: 92%, 88 Points needed

    Level up: 92% Level up: 92% Level up: 92%

    Activity: 2.5%

    Activity: 2.5% Activity: 2.5% Activity: 2.5%

    Last Achievements
    ImGui theme colorImGui theme colorImGui theme color

    ImGui theme color


    Designations of colors.

    Code:

    [ImGuiCol_Text] = The color for the text that will be used for the whole menu. 
    [ImGuiCol_TextDisabled] = Color for "not active / disabled text". 
    [ImGuiCol_WindowBg] = Background color. 
    [ImGuiCol_PopupBg] = The color used for the background in ImGui :: Combo and ImGui :: MenuBar. 
    [ImGuiCol_Border] = The color that is used to outline your menu. 
    [ImGuiCol_BorderShadow] = Color for the stroke shadow. 
    [ImGuiCol_FrameBg] = Color for ImGui :: InputText and for background ImGui :: Checkbox
    [ImGuiCol_FrameBgHovered] = The color that is used in almost the same way as the one above, except that it changes color when guiding it to ImGui :: Checkbox. 
    [ImGuiCol_FrameBgActive] = Active color. 
    [ImGuiCol_TitleBg] = The color for changing the main place at the very top of the menu (where the name of your "top-of-the-table" is shown. 
    ImGuiCol_TitleBgCollapsed = ImguiCol_TitleBgActive 
    = The color of the active title window, ie if you have a menu with several windows , this color will be used for the window in which you will be at the moment. 
    [ImGuiCol_MenuBarBg] = The color for the bar menu. (Not all sawes saw this, but still)
    [ImGuiCol_ScrollbarBg] = The color for the background of the "strip", through which you can "flip" functions in the software vertically. 
    [ImGuiCol_ScrollbarGrab] = Color for the scoll bar, ie for the "strip", which is used to move the menu vertically. 
    [ImGuiCol_ScrollbarGrabHovered] = Color for the "minimized / unused" scroll bar. 
    [ImGuiCol_ScrollbarGrabActive] = The color for the "active" activity in the window where the scroll bar is located. 
    [ImGuiCol_ComboBg] = Color for the background for ImGui :: Combo. 
    [ImGuiCol_CheckMark] = Color for your ImGui :: Checkbox. 
    [ImGuiCol_SliderGrab] = Color for the slider ImGui :: SliderInt and ImGui :: SliderFloat. 
    [ImGuiCol_SliderGrabActive] = Color of the slider,
    [ImGuiCol_Button] = the color for the button. 
    [ImGuiCol_ButtonHovered] = Color when hovering over the button. 
    [ImGuiCol_ButtonActive] = Button color used. 
    [ImGuiCol_Header] = Color for ImGui :: CollapsingHeader. 
    [ImGuiCol_HeaderHovered] = Color, when hovering over ImGui :: CollapsingHeader. 
    [ImGuiCol_HeaderActive] = Used color ImGui :: CollapsingHeader. 
    [ImGuiCol_Column] = Color for the "separation strip" ImGui :: Column and ImGui :: NextColumn. 
    [ImGuiCol_ColumnHovered] = Color, when hovering on the "strip strip" ImGui :: Column and ImGui :: NextColumn. 
    [ImGuiCol_ColumnActive] = The color used for the "separation strip" ImGui :: Column and ImGui :: NextColumn.
    [ImGuiCol_ResizeGrip] = The color for the "triangle" in the lower right corner, which is used to increase or decrease the size of the menu. 
    [ImGuiCol_ResizeGripHovered] = Color, when hovering to the "triangle" in the lower right corner, which is used to increase or decrease the size of the menu. 
    [ImGuiCol_ResizeGripActive] = The color used for the "triangle" in the lower right corner, which is used to increase or decrease the size of the menu. 
    [ImGuiCol_CloseButton] = The color for the button-closing menu. 
    [ImGuiCol_CloseButtonHovered] = Color, when you hover over the button-close menu. 
    [ImGuiCol_CloseButtonActive] = The color used for the button-closing menu.
    [ImGuiCol_TextSelectedBg] = The color of the selected text, in ImGui :: MenuBar. 
    [ImGuiCol_ModalWindowDarkening] = The color of the "Blackout Window" of your menu. 
    I rarely see these designations, but still decided to put them here. 
    [ImGuiCol_Tab] = The color for tabs in the menu. 
    [ImGuiCol_TabActive] = The active color of tabs, ie when you click on the tab you will have this color.
    [ImGuiCol_TabHovered] = The color that will be displayed when hovering on the table. 
    [ImGuiCol_TabSelected] = The color that is used when you are in one of the tabs. 
    [ImGuiCol_TabText] = Text color that only applies to tabs. 
    [ImGuiCol_TabTextActive] = Active text color for tabs.

    greatR is offline

    Reply With Quote

    Old
    25th March 2018, 10:02 PM

     
    #2

    T0b1

    Supreme H4x0|2

    T0b1's Avatar

    Join Date: Oct 2016

    Location: Germany


    Posts: 654

    Reputation: 10474

    Rep Power: 0

    T0b1 's rep takes up 1 gig of server spaceT0b1 's rep takes up 1 gig of server spaceT0b1 's rep takes up 1 gig of server spaceT0b1 's rep takes up 1 gig of server spaceT0b1 's rep takes up 1 gig of server spaceT0b1 's rep takes up 1 gig of server spaceT0b1 's rep takes up 1 gig of server spaceT0b1 's rep takes up 1 gig of server spaceT0b1 's rep takes up 1 gig of server spaceT0b1 's rep takes up 1 gig of server spaceT0b1 's rep takes up 1 gig of server space

    Recognitions
    Award symbolizing a retired staff member who dedicated a notable amount of time and effort to their past staff position.
    Former Staff

    Points: 18,209, Level: 18

    Points: 18,209, Level: 18 Points: 18,209, Level: 18 Points: 18,209, Level: 18

    Level up: 28%, 1,091 Points needed

    Level up: 28% Level up: 28% Level up: 28%

    Activity: 9.8%

    Activity: 9.8% Activity: 9.8% Activity: 9.8%

    Last Achievements
    ImGui theme colorImGui theme color

    Okay, so most of the Colors are self-explanatory, ImGui has a documentation which explains the ones that are not that clear, this explanation contains Colors/Functions which dont even exist in default ImGui and some explanations are even wrong (e.g. «The color for the background of the «strip», through which you can «flip» functions in the software vertically» — like what is this explanation for a scrollbar and why does it even need an explanation?)
    Maybe try not using google translator next time cause it really looks like you did and check if this is even needed when the colors are self-explanatory — atleast in my opinion


    T0b1 is offline

    Reply With Quote

    Reply


    Similar Threads
    Thread Thread Starter Forum Replies Last Post
    [Help] imGui Color picker ihatefatpeop C and C++ 9 9th October 2017 04:52 PM
    [Help] ImGui Color Slider Change All Colors With Certain Atrribute? officialAbyssal General Programming and Reversing 9 23rd August 2017 05:31 AM
    [Help] Errors when trying to add ImGui color sliders. officialAbyssal General Programming and Reversing 11 20th August 2017 08:34 PM
    [Help] ImGui Color Sliders Changing ESP Colors? officialAbyssal General Programming and Reversing 0 17th August 2017 03:57 AM
    [Question] Adding color picker to ImGUI menu? officialAbyssal General Programming and Reversing 4 11th August 2017 06:21 AM

    Tags

    color, imgui, menu, strip, active, tabs, hovering, text, background, bar

    «
    Previous Thread
    |
    Next Thread
    »

    Forum Jump

    All times are GMT. The time now is 09:00 PM.

    Contact Us —
    Toggle Dark Theme

    Terms of Use Information Privacy Policy Information
    Copyright ©2000-2023, Unknowncheats� UKCS #312436

    ImGui theme color ImGui theme color

    no new posts

    Понравилась статья? Поделить с друзьями:

    Читайте также:

  • Как изменить цвет html текст
  • Как изменить цвет header wordpress
  • Как изменить цвет header css
  • Как изменить цвет groupbox
  • Как изменить цвет footer html

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии