Módulo:Rgba/doc
Esta é a página de documentação para Módulo:Rgba
Módulo:Rgba requer Module:LibraryUtil.
Este módulo é um módulo de apoio para ser usado por outros módulos; ele pode não ser projetado para ser invocado diretamente. See RuneScape:Lua/Helper modules for a full list and more information.
Módulo | Função | Tipo | Uso | Example |
---|---|---|---|---|
Rgba | new( red, [green|0], [blue|0], [alpha|1] ) new( hex ) | number/string, number/nil, number/nil, number/nil | Returns a new rgba object. Values red , green and blue are in the range 0-255; alpha is 0-1. It is also possible to give a hex string e.g. #112233 or #11223344 .
When converted to a string with tostring( rgba ) it will return a string in the form rgba(r,b,g,a) where r, g, b and a are filled in with numbers. | |
rgba:lighten( val ) | number | Returns a new rgba object with its brightness changed. 1 is no change, 0 is complete black, 2 is double brightness, 1.1 is 10% more, 0.5 is halve, etc. | ||
rgba:darken( val ) | number | Returns a new rgba object with its brightness changed. 1 is no change, 0 is complete white, 2 is halve brightness, 1.1 is 10% darker, 0.5 is double brightness, etc. | ||
rgba:hueRotate( num ) | number | Returns a new rgba object with its hue num degrees rotated. Decimal values are allowed. | ||
rgba:saturate( val ) | number | Returns a new rgba object with its saturation changed. 1 is no change, 0 is greyscale, 2 is double saturation, 1.5 is 50% more, etc. | ||
rgba:fade( val ) | number | Returns a new rgba object with its alpha value set to val . val is clipped to the range 0-1. | ||
rgba:clone() | N/A | Returns a copy with the same values. |