Color

A color composed of components (R, G, B, A) with floating point precision. The values are between 0 and 1.

Tip

This structure is Open Sourced at https://github.com/nanos-world/nanos-world-lua-lib. Feel free to push merge requests and suggest changes!

Tip

This structure supports +, -, *, /, ==, and tostring operations.

Usage

local GreyColor = Color(0.5, 0.5, 0.5, 1)

Properties

Type

Name

Description

number

R

Red color percentage (0-1)

number

G

Green color percentage (0-1)

number

B

Blue color percentage (0-1)

number

A

Alpha color percentage (0-1). Alpha is the transparency. 0 -> fully transparency and 1 -> no transparency