# File lib/pixels.rb, line 539 539: def color_from_rgba(r, g, b, a) 540: # Convert 8 bits-per-channel to 5 bits-per-channel 541: r5 = (r.to_i >> 3) & 0x1f 542: g5 = (g.to_i >> 3) & 0x1f 543: b5 = (b.to_i >> 3) & 0x1f 544: a1 = (a.to_i >> 7) & 1 545: return (a1 << 15) | (b5 << 10) | (g5 << 5) | r5 546: end