> For the complete documentation index, see [llms.txt](https://brady-xyz.gitbook.io/maclib-ui-library/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brady-xyz.gitbook.io/maclib-ui-library/getting-started/loading-maclib/creating-a-window/creating-a-tab-group/adding-tabs/adding-sections/colorpicker.md).

# Colorpicker

<figure><img src="https://2943218207-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhRtWRcExHV8IBJHoV9bx%2Fuploads%2FV1Fw3vj0z73KH6sxkW0L%2Fimage.png?alt=media&amp;token=aeaeae37-1f80-4426-8c3e-d62cd9b2e1e9" alt=""><figcaption></figcaption></figure>

```lua
Section:Colorpicker({
  Name <string>
  Default <color3>
  Alpha <number or nil> -- Transparency
  Callback <function(): color3, number>
}, <string or nil> Flag)
```

Functions

```lua
:UpdateName(<string>)
:SetVisibility(<boolean>)
:SetColor(<color3>)
:SetAlpha(<number>)

.Color : color3
.Alpha : number
.IgnoreConfig <boolean>
.Settings : table -- Not everything may be updated, but Callback should be correct.
```

Example

```lua
sections.MainSection1:Colorpicker({
	Name = "ESP Color",
	Default = Color3.fromRGB(255,0,0),
	Alpha = 0,
	Callback = function(color, alpha)
		local r, g, b = math.round(color.R * 255), math.round(color.G * 255), math.round(color.B * 255)
		local formattedColor = string.format("%d, %d, %d", r, g, b)

		Window:Notify({
			Title = "Kuzu Hub",
			Description = string.format("Changed ESP Color\nColor: %s\nAlpha: %.2f", formattedColor, alpha),
			Lifetime = 3
		})
	end,
}, "ESPColorToggle")
```
