Module: Pixelflut::Canvas::Base::Color
- Defined in:
- lib/pixelflut/canvas/color.rb
Constant Summary collapse
- Black =
from_rgba(0, 0, 0, 0xff)
- White =
from_rgba(0xff, 0xff, 0xff, 0xff)
- Red =
from_rgba(0xff, 0, 0, 0xff)
- Green =
from_rgba(0, 0xff, 0, 0xff)
- Blue =
from_rgba(0, 0, 0xff, 0xff)
- Yellow =
from_rgba(0xff, 0xff, 0, 0xff)
Class Method Summary collapse
Class Method Details
.from_rgb(r, g, b) ⇒ Object
6 7 8 |
# File 'lib/pixelflut/canvas/color.rb', line 6 def from_rgb(r, g, b) from_rgba(r, g, b, 0xff) end |
.from_rgba(r, g, b, a) ⇒ Object
10 11 12 |
# File 'lib/pixelflut/canvas/color.rb', line 10 def from_rgba(r, g, b, a) as_hex(r) + as_hex(g) + as_hex(b) + as_hex(a) end |