Skip to main content

Color3SerializationUtils

Utility functions to help serialize Color3 values

Types

SerializedColor3

type SerializedColor3 = {
[1]number,
[2]number,
[3]number
}

Functions

serialize

Color3SerializationUtils.serialize(color3Color3) → SerializedColor3

Serializes a Color3 into a JSON or DataStore safe value.

isSerializedColor3

Color3SerializationUtils.isSerializedColor3(color3any) → boolean

Returns whether a value is a serialized Color3

fromRGB

Color3SerializationUtils.fromRGB(
rnumber,
gnumber,
bnumber
) → SerializedColor3

Creates a SerializedColor3 from r g b (0, 255)

deserialize

Color3SerializationUtils.deserialize(color3Color3) → SerializedColor3

Deserializes the color into a Color3

Show raw api
{
    "functions": [
        {
            "name": "serialize",
            "desc": "Serializes a Color3 into a JSON or DataStore safe value.",
            "params": [
                {
                    "name": "color3",
                    "desc": "",
                    "lua_type": "Color3"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SerializedColor3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 18,
                "path": "src/color3serializationutils/src/Shared/Color3SerializationUtils.lua"
            }
        },
        {
            "name": "isSerializedColor3",
            "desc": "Returns whether a value is a serialized Color3",
            "params": [
                {
                    "name": "color3",
                    "desc": "",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 31,
                "path": "src/color3serializationutils/src/Shared/Color3SerializationUtils.lua"
            }
        },
        {
            "name": "fromRGB",
            "desc": "Creates a SerializedColor3 from r g b (0, 255)",
            "params": [
                {
                    "name": "r",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "g",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "b",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SerializedColor3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 42,
                "path": "src/color3serializationutils/src/Shared/Color3SerializationUtils.lua"
            }
        },
        {
            "name": "deserialize",
            "desc": "Deserializes the color into a Color3",
            "params": [
                {
                    "name": "color3",
                    "desc": "",
                    "lua_type": "Color3"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SerializedColor3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 59,
                "path": "src/color3serializationutils/src/Shared/Color3SerializationUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "SerializedColor3",
            "desc": "",
            "lua_type": "{ [1]: number, [2]: number, [3]: number }",
            "source": {
                "line": 12,
                "path": "src/color3serializationutils/src/Shared/Color3SerializationUtils.lua"
            }
        }
    ],
    "name": "Color3SerializationUtils",
    "desc": "Utility functions to help serialize Color3 values",
    "source": {
        "line": 5,
        "path": "src/color3serializationutils/src/Shared/Color3SerializationUtils.lua"
    }
}