LLumaGauge
Product

Product features · Relative luminance contrast

01

LumaGauge supports examination of sRGB linearization and luminance ratios while keeping a numeric contrast result separate from a complete accessibility assessment.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Relative luminance contrast

● ● ●LumaGauge●
A concrete starting point · Relative luminance contrast ×
def contrast_ratio(left, right):
    def luminance(rgb):
        if type(rgb) not in (list, tuple) or len(rgb) != 3:
            raise ValueError("rgb.container")
        rgb = tuple(rgb)
        if len(rgb) != 3 or any(type(c) is not int or not 0 <= c <= 255 for c in rgb):
            raise ValueError("rgb.channel")
        channels = [c / 255 for c in rgb]
        linear = [c / 12.92 if c <= 0.04045 else ((c + 0.055) / 1.055)**2.4
                  for c in channels]
        return sum(c * w for c, w in zip(linear, (0.2126, 0.7152, 0.0722)))
    a, b = sorted((luminance(left), luminance(right)))
    return (b + 0.05) / (a + 0.05)
✳Calculate relative-luminance contrast between two three-channel eight-bit RGB colors.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗