> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# ImGuiWindow.ColorPicker

> Appends a RGBA color editor to an ImGuiWindow and stores the callback. Missing or nil color components default to 1.0. When the rendered editor changes, the callback is queued and later invoked with red, green, blue, and alpha. The method returns the same ImGuiWindow object.

<div className="real-function-page">
  ```lua theme={null}
  ImGuiWindow.ColorPicker(window: ImGuiWindow, label: string, red?: number, green?: number, blue?: number, alpha?: number, onChange: function): ImGuiWindow
  ```

  ## الوسائط

  <ParamField path={"window"} type={"ImGuiWindow"} required>
    ImGuiWindow object returned by imgui.create. A destroyed or invalid window raises a Lua error.
  </ParamField>

  <ParamField path={"label"} type={"string"} required>
    Color editor label string passed to the rendered ImGui ColorEdit4 widget.
  </ParamField>

  <ParamField path={"red"} type={"number"}>
    Initial red component read with luaL\_optnumber; defaults to 1.0 when omitted or nil.
  </ParamField>

  <ParamField path={"green"} type={"number"}>
    Initial green component read with luaL\_optnumber; defaults to 1.0 when omitted or nil.
  </ParamField>

  <ParamField path={"blue"} type={"number"}>
    Initial blue component read with luaL\_optnumber; defaults to 1.0 when omitted or nil.
  </ParamField>

  <ParamField path={"alpha"} type={"number"}>
    Initial alpha component read with luaL\_optnumber; defaults to 1.0 when omitted or nil.
  </ParamField>

  <ParamField path={"onChange"} type={"function"} required>
    Function stored for this color editor and invoked with red, green, blue, and alpha after a change event is processed. It must be supplied as argument 7.
  </ParamField>

  ## القيم الراجعة

  <ResponseField name={"window"} type={"ImGuiWindow"}>
    The same ImGuiWindow object, allowing chained method calls.
  </ResponseField>

  ## الأنواع

  ### ImGuiWindow

  تم إرجاع المقبض بواسطة imgui.create. تقوم أساليب بناء التحكم بإرجاع نفس المقبض بحيث يمكن ربط المكالمات بالتسلسل.

  | Name               | Type                                                                                                                                            | Required | الوصف                                                                          |
  | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------ |
  | `Button`           | `(label: string, onClick: () -> ()) -> ImGuiWindow`                                                                                             | Yes      | يُلحق زرًا ويستدعي رد الاتصال بعد النقر.                                       |
  | `Checkbox`         | `(label: string, checked: any, onChange: (boolean) -> ()) -> ImGuiWindow`                                                                       | Yes      | يُلحق مربع اختيار تمت تهيئته بالحالة المتوفرة.                                 |
  | `CollapsingHeader` | `(label: string, content: (ImGuiWindow) -> ()) -> ImGuiWindow`                                                                                  | Yes      | يتم إلحاق عناصر التحكم في المجموعات بواسطة رد اتصال المحتوى أسفل الرأس المطوي. |
  | `ColorPicker`      | `(label: string, red: number?, green: number?, blue: number?, alpha: number?, onChange: (number, number, number, number) -> ()) -> ImGuiWindow` | Yes      | إلحاق محرر RGBA؛ تم حذف مكونات اللون الافتراضية إلى 1.0.                       |
  | `InputText`        | `(label: string, text: string?, onChange: (string) -> ()) -> ImGuiWindow`                                                                       | Yes      | إلحاق إدخال نص من سطر واحد؛ تم حذف النص الأولي الافتراضي إلى سلسلة فارغة.      |
  | `SameLine`         | `() -> ImGuiWindow`                                                                                                                             | Yes      | يضع عنصر التحكم التالي على نفس السطر.                                          |
  | `Separator`        | `() -> ImGuiWindow`                                                                                                                             | Yes      | إلحاق فاصل أفقي.                                                               |
  | `SliderFloat`      | `(label: string, value: number, minimum: number, maximum: number, onChange: (number) -> ()) -> ImGuiWindow`                                     | Yes      | إلحاق شريط تمرير النقطة العائمة.                                               |
  | `SliderInt`        | `(label: string, value: integer, minimum: integer, maximum: integer, onChange: (number) -> ()) -> ImGuiWindow`                                  | Yes      | إلحاق شريط تمرير عدد صحيح.                                                     |
  | `Text`             | `(text: string) -> ImGuiWindow`                                                                                                                 | Yes      | إلحاق نص غير تفاعلي.                                                           |
  | `destroy`          | `() -> ()`                                                                                                                                      | Yes      | إزالة النافذة وتحرير عمليات الاسترجاعات المسجلة الخاصة بها.                    |
</div>
