-
Notifications
You must be signed in to change notification settings - Fork 1
melon.colors
melon.colors
Handles color modification and other things
melon

melon.colors.Alpha(color: Color, alpha: number) -> Color
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | color | Color | The color |
| 2 | alpha | number | The wanted alpha |
| # | 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(original: Color) -> Color
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | original | Color | To color |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | new | Color | New color object |
Returns a new invalidlink(Color) thats a copy of the original given

melon.colors.CopyShallow(original: Color) -> table
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | original | Color | To color |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | new | table | New color |

melon.colors.FastColor(r: number, g: number, b: number, a: number) -> table
Argument and Return information
| # | 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 |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | color | table | The new fake color |
Creates a color without the color metatable

melon.colors.FromHex(hex: string) -> Color
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hex | string | Hex color |
| # | 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.IsColor(any) -> bool?
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | any | any | Value to check |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | bool | bool | Is this a color |
Checks if the given object qualifies as an engine-readable color

melon.colors.IsLight(col: Color) -> bool
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | col | Color | Color to check |
| # | 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(amt: number, from: Color, to: Color) -> Color
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | amt | number | Amount to interpolate by |
| 2 | from | Color | From color |
| 3 | to | Color | To color |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | new | Color | New color object |
Returns a new invalidlink(Color) thats interpolated by from/to

melon.colors.LerpMod(amt: number, mod: Color, to: Color)
Argument and Return information
| # | 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(color: Color, amt: number) -> Color
Argument and Return information
| # | Name | Type | Description |
|---|---|---|---|
| 1 | color | Color | The color to lighten |
| 2 | amt | number | How much to lighten the color |
| # | Name | Type | Description |
|---|---|---|---|
| 1 | color | Color | The new, lightened color |
Lightens a color linearly and returns a new color