four.Color
.Color (r, g, b, a)
local lib = { type = 'four.Color' } lib.__index = lib four.Color = lib setmetatable(lib, { __call = function(lib, ...) return lib.Color(...) end })
local V4 = four.V4
-- h2. Constructors and accessors
--[[-- @Color(r, g, b [,a])@ is a color with the corresponding components. @a@ is @1@ if unspecified.
@Color(o)@ is a color converted from the object @o@. Supported types for @o@: none.
.HSV (h, s, v, a)
@HSV(h, s, v [,a])@ is an RGBA color with hue @h@, staturation @s@, and value @v@. @a@ is @1@ if unspecified.
Important HSV components are all in the @0@ to @1@ range.
.r (c)
@r(c)@ is the @r@ component of @c@.
.g (c)
@g(c)@ is the @g@ component of @c@.
.b (c)
@b(c)@ is the @b@ component of @c@.
.a (c)
@a(c)@ is the @a@ component of @c@.
.h (c)
@h(c)@ is the hue component of @c@.
.s (c)
@s(c)@ is the staturation component of @c@.
.v (c)
@v(c)@ is the value component of @c@.
.toHSV (c)
@toHSV(c) is V4(h, s, v, a), the HSV components of @c@.
.tuple = V4.tuple
@tuple(c)@ is @r, g, b, a@, the components of @c@.
.tupleHSV (c)
@tupleHSV(c)@ is @h, s, v, a@ the components of @c@.
.tostring = V4.tostring
@tostring(c)@ is a textual representation of @c@.
.tostringHSV (c)
@tostringHSV(c)@ is a textual representation of @c@.
.void ()
@void()@ is @Color(0, 0, 0, 0)@.
.black ()
@black()@ is @Color(0, 0, 0, 1)@.
.white ()
@white()@ is @Color(1, 1, 1, 1)@.
.gray (g, a)
@gray(g [,a])@ is @Color(g, g, g, a)@. @a@ is @1@ if unspecified.
.red (a)
@red([,a])@ is @Color(1, 0, 0, a)@. @a@ is @1@ if unspecified.
.green (a)
@green([,a])@ is @Color(0, 1, 0, a)@. @a@ is @1@ if unspecified.
.blue (a)
@blue([,a])@ is @Color(0, 0, 1, a)@. @a@ is @1@ if unspecified.