Skip to main content

Palette

Easy color picker that uses the Material color system

Available colors:

  • red
  • orange
  • yellow
  • gold
  • green
  • blue
  • purple
  • blue-gray
  • gray

Available shades:

  • 50
  • 100
  • 200
  • 300
  • 400
  • 500 (default)
  • 600
  • 700
  • 800
  • 900

Color Guide

Install with wally by adding the following to your wally.toml:

Palette = "dig1t/palette@1.0.1"

Functions

get

Palette.get(
colorstring,--

The color to use

shadenumber?--

The shade to use. Defaults to 500.

) → Color3

Creates a Color3 object from the given color and shade.

Example:

local button: TextButton = Instance.new("TextButton")
local btnColor: Color3 = Palette("blue", 500)
local btnHover: Color3 = Palette("blue", 300)

button.BackgroundColor3 = btnColor

button.MouseEnter:Connect(function()
	btn.BackgroundColor3 = btnHover
end)

button.MouseLeave:Connect(function()
	btn.BackgroundColor3 = btnColor
end)
Show raw api
{
    "functions": [
        {
            "name": "get",
            "desc": "Creates a Color3 object from the given color and shade.\n\n#### Example:\n```lua\nlocal button: TextButton = Instance.new(\"TextButton\")\nlocal btnColor: Color3 = Palette(\"blue\", 500)\nlocal btnHover: Color3 = Palette(\"blue\", 300)\n\nbutton.BackgroundColor3 = btnColor\n\nbutton.MouseEnter:Connect(function()\n\tbtn.BackgroundColor3 = btnHover\nend)\n\nbutton.MouseLeave:Connect(function()\n\tbtn.BackgroundColor3 = btnColor\nend)\n```",
            "params": [
                {
                    "name": "color",
                    "desc": "The color to use",
                    "lua_type": "string"
                },
                {
                    "name": "shade",
                    "desc": "The shade to use. Defaults to 500.",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Color3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 194,
                "path": "src/Palette/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Palette",
    "desc": "Easy color picker that uses the Material color system\n\nAvailable colors:\n- red\n- orange\n- yellow\n- gold\n- green\n- blue\n- purple\n- blue-gray\n- gray\n\nAvailable shades:\n- 50\n- 100\n- 200\n- 300\n- 400\n- 500 (default)\n- 600\n- 700\n- 800\n- 900\n\n![Color Guide](https://i.imgur.com/t956Y4J.png)\n\nInstall with wally by adding the following to your `wally.toml`:\n```toml\nPalette = \"dig1t/palette@1.0.1\"\n```",
    "source": {
        "line": 168,
        "path": "src/Palette/init.luau"
    }
}