Skip to main content

colorUtil

A simple utility module for working with colors.

Functions

darkenColor

colorUtil.darkenColor(
colorColor3,
deltanumber
) → Color3

Returns a darker version of the given color. delta is the amount by which the given color should be darkened.

clampColor

colorUtil.clampColor(
colorOrColorSequenceColor3 | ColorSequence,
clampComponents{
minHnumber,
maxHnumber,
minSnumber,
maxSnumber,
minVnumber,
maxVnumber,
}
) → Color3 | ColorSequence

Returns a clamped version of the given colorOrColorSequence.

Show raw api
{
    "functions": [
        {
            "name": "darkenColor",
            "desc": "Returns a darker version of the given color. `delta` is the amount by which the given color\nshould be darkened.",
            "params": [
                {
                    "name": "color",
                    "desc": "",
                    "lua_type": "Color3"
                },
                {
                    "name": "delta",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Color3\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 15,
                "path": "src/colorUtil/init.luau"
            }
        },
        {
            "name": "clampColor",
            "desc": "Returns a clamped version of the given `colorOrColorSequence`.",
            "params": [
                {
                    "name": "colorOrColorSequence",
                    "desc": "",
                    "lua_type": "Color3 | ColorSequence"
                },
                {
                    "name": "clampComponents",
                    "desc": "",
                    "lua_type": "{\n\t\tminH: number,\n\t\tmaxH: number,\n\t\tminS: number,\n\t\tmaxS: number,\n\t\tminV: number,\n\t\tmaxV: number,\n\t}\n"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Color3 | ColorSequence\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 24,
                "path": "src/colorUtil/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "colorUtil",
    "desc": " \n\nA simple utility module for working with colors.",
    "source": {
        "line": 8,
        "path": "src/colorUtil/init.luau"
    }
}