MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / hex_color

Method hex_color

pager/pagerctl.py:352–357  ·  view source on GitHub ↗

Convert 0xRRGGBB to RGB565.

(rgb_hex)

Source from the content-addressed store, hash-verified

350
351 @staticmethod
352 def hex_color(rgb_hex):
353 """Convert 0xRRGGBB to RGB565."""
354 r = (rgb_hex >> 16) & 0xFF
355 g = (rgb_hex >> 8) & 0xFF
356 b = rgb_hex & 0xFF
357 return Pager.rgb(r, g, b)
358
359 # Drawing primitives
360 def pixel(self, x, y, color):

Callers

nothing calls this directly

Calls 1

rgbMethod · 0.45

Tested by

no test coverage detected