Representation for a single colour pixel. The shortcut for RGB.new( r, g, b ) is RGB( r, g, b ).
| RGB | Representation for a single colour pixel. |
| Properties | |
| r | Red colour component. |
| g | Green colour component. |
| b | Blue colour component. |
| Functions | |
| RGB.new | Constructor. |
| RGB. | Used internally. |
| inspect | Return string with information about this object. |
| integer? | Used internally. |
| grey | Convert to grey-value. |
| +@ | The plus operator has no effect. |
| -@ | Return negative element. |
| + | Add a scalar or another RGB-object. |
| - | Subtract a scalar or another RGB-object. |
| * | Multiply with a scalar or another RGB-object. |
| / | Divide by a scalar value or another RGB-object. |
| % | Remainder of division with scalar value or another RGB-object. |
| ** | Element-wise power using a scalar value or another RGB-object. |
| zero? | Check whether red, green, and blue component are zero. |
| nonzero? | Check whether red, green, or blue component is not zero. |
| major | Choose larger value for each channel and return result. |
| minor | Choose smaller value for each channel and return result. |
| < | Test for lower than. |
| & | Bitwise and. |
| | | Bitwise or. |
| ^ | Bitwise xor. |
| << | Shift left. |
| <= | Test for lower than or equal. |
| > | Test for greater than. |
| >= | Test for greater than or equal. |
| <=> | Comparison operator. |
| coerce | Type coercion (used internally). |
| jit_assign | Used internally to enable JIT-compilation of variable-assignments. |
| jit_alloc | Used internally to enable JIT-compilation of allocation of variable. |
Constructor.
def RGB.new( r, g, b )
Used internally.
def RGB.generic?( value )
Return string with information about this object.
def inspect
Used internally.
def integer?
Convert to grey-value.
def grey
The plus operator has no effect.
def +@
Return negative element.
def -@
Add a scalar or another RGB-object.
def +( other )
Subtract a scalar or another RGB-object.
def -( other )
Multiply with a scalar or another RGB-object.
def *( other )
Divide by a scalar value or another RGB-object.
def /( other )
Remainder of division with scalar value or another RGB-object.
def %( other )
Element-wise power using a scalar value or another RGB-object.
def **( other )
Check whether red, green, and blue component are zero.
def zero?
Check whether red, green, or blue component is not zero.
def nonzero?
Choose larger value for each channel and return result.
def major( other )
Choose smaller value for each channel and return result.
def minor( other )
Bitwise or.
def |( other )
Bitwise xor.
def ^( other )
Test for greater than or equal.
def >=( other )
Type coercion (used internally).
def coerce( other )
Used internally to enable JIT-compilation of variable-assignments.
def jit_assign( value )
Used internally to enable JIT-compilation of allocation of variable.
def jit_alloc