Skip to content

melon.colors

garryspins edited this page Feb 27, 2026 · 5 revisions

melon.colors


client link

Handles color modification and other things
melon

Functions

melon.colors.Alpha

client link
melon.colors.Alpha(color: Color, alpha: number) -> Color

Argument and Return information

Arguments

# Name Type Description
1 color Color The color
2 alpha number The wanted alpha

Returns

# Name Type Description
1 color Color The new, modified color

Creates a quick copy of the given color with the alpha given

melon.colors.Copy

client link
melon.colors.Copy(original: Color) -> Color

Argument and Return information

Arguments

# Name Type Description
1 original Color To color

Returns

# Name Type Description
1 new Color New color object

Returns a new invalidlink(Color) thats a copy of the original given

melon.colors.CopyShallow

client link
melon.colors.CopyShallow(original: Color) -> table

Argument and Return information

Arguments

# Name Type Description
1 original Color To color

Returns

# Name Type Description
1 new table New color
Returns a new table thats a copy of the original given, same as melon.colors.Copy but without the metatable

melon.colors.FC

client link

[!NOTE]
This is an alias of melon.colors.FastColor

melon.colors.FastColor

client link
melon.colors.FastColor(r: number, g: number, b: number, a: number) -> table

Argument and Return information

Arguments

# Name Type Description
1 r number The red component
2 g number The red component
3 b number The red component
4 a number The red component

Returns

# Name Type Description
1 color table The new fake color

Creates a color without the color metatable

melon.colors.FromHex

client link
melon.colors.FromHex(hex: string) -> Color

Argument and Return information

Arguments

# Name Type Description
1 hex string Hex color

Returns

# Name Type Description
1 col Color New color object

Converts a hex color of 3, 4, 6 or 8 characters into a invalidlink(Color) object

melon.colors.Is

client link

[!NOTE]
This is an alias of melon.colors.IsColor

melon.colors.IsColor

client link
melon.colors.IsColor(any) -> bool?

Argument and Return information

Arguments

# Name Type Description
1 any any Value to check

Returns

# Name Type Description
1 bool bool Is this a color

Checks if the given object qualifies as an engine-readable color

melon.colors.IsLight

client link
melon.colors.IsLight(col: Color) -> bool

Argument and Return information

Arguments

# Name Type Description
1 col Color Color to check

Returns

# Name Type Description
1 dark bool Is the color light or dark

Get if a color is dark or light, primarily for dynamic text colors

melon.colors.Lerp

client link
melon.colors.Lerp(amt: number, from: Color, to: Color) -> Color

Argument and Return information

Arguments

# Name Type Description
1 amt number Amount to interpolate by
2 from Color From color
3 to Color To color

Returns

# Name Type Description
1 new Color New color object

Returns a new invalidlink(Color) thats interpolated by from/to

melon.colors.LerpMod

client link
melon.colors.LerpMod(amt: number, mod: Color, to: Color)

Argument and Return information

Arguments

# Name Type Description
1 amt number Amount to interpolate by
2 mod Color Color to modify
3 to Color To color

Modifies the given color for optimization reasons, be careful.

melon.colors.Lighten

client link
melon.colors.Lighten(color: Color, amt: number) -> Color

Argument and Return information

Arguments

# Name Type Description
1 color Color The color to lighten
2 amt number How much to lighten the color

Returns

# Name Type Description
1 color Color The new, lightened color

Lightens a color linearly and returns a new color

melon.colors.Rainbow

client link
melon.colors.Rainbow(mul: number, offset: number) -> Color

Argument and Return information

Arguments

# Name Type Description
1 mul number Number to multiply time by, optional
2 offset number Hue to offset the time by

Returns

# Name Type Description
1 color Color Rainbow color

Generates a consistent rainbow color

melon.colors.ToHex

client link
melon.colors.ToHex(color: Color) -> string

Argument and Return information

Arguments

# Name Type Description
1 color Color Real Color

Returns

# Name Type Description
1 hex string Hex Color Output

Converts a Color to a hex color of 3, 4, 6 or 8 chars

Clone this wiki locally