Dark-Mode Lightness Inversion Heuristic
Apply explicitly heuristic HSL lightness inversion and caller dark-mode bounds, retaining hue/saturation and clipping evidence; not accessible theming, contrast compliance or perceptual inversion.
Description
A dark-theme heuristic can invert HSL lightness and constrain it to chosen bounds.
A dark-theme heuristic can invert HSL lightness and constrain it to chosen bounds. Contrast needs a separate check.1
Enter normalized RGB and ordered lightness bounds 0–1. Convert to HSL, retain hue/saturation and invert/clamp lightness. Return HSL/RGB and clipping flag.
When to use Dark-Mode Lightness Inversion Heuristic
Use Dark-Mode Lightness Inversion Heuristic when you need to evaluate the supplied records under the calculation and evidence rules below. No accessible theming, contrast compliance or perceptual inversion is established.
Prepare colors in the stated color space and scale. Use encoded RGB fractions, linear RGB, Lab, xy, byte values or ink percentages exactly as requested; supply caller tolerances and reference conditions.
How to use Dark-Mode Lightness Inversion Heuristic and understand its results
- Prepare colors in the stated color space and scale. Use encoded RGB fractions, linear RGB, Lab, xy, byte values or ink percentages exactly as requested; supply caller tolerances and reference conditions.
- Enter baseRgb, callerMinimumDarkModeLightness, callerMaximumDarkModeLightness using the field table and calculation rules, then run the tool.
- Read heuristicDarkHsl, heuristicDarkRgb, invertedLightnessClipped. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| baseRgb | Base rgb | list of number | Required |
| callerMinimumDarkModeLightness | Caller minimum dark mode lightness | number | Required |
| callerMaximumDarkModeLightness | Caller maximum dark mode lightness | number | Required |
Enter normalized RGB and ordered lightness bounds 0–1. Convert to HSL, retain hue/saturation and invert/clamp lightness. Return HSL/RGB and clipping flag.
rawLightness=1−original; outputLightness=clamp(raw,callerBounds) Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| heuristicDarkHsl | Heuristic dark hsl | list of number |
| heuristicDarkRgb | Heuristic dark rgb | list of number |
| invertedLightnessClipped | Inverted lightness clipped | boolean |
{
"input": {
"baseRgb": [
1,
0,
0
],
"callerMinimumDarkModeLightness": 0.1,
"callerMaximumDarkModeLightness": 0.4
},
"output": {
"heuristicDarkHsl": [
0,
1,
0.4
],
"heuristicDarkRgb": [
0.8,
0,
0
],
"invertedLightnessClipped": true
}
} Limitations and assumptions
No accessible theming, contrast compliance or perceptual inversion is established.
Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Numeric lists are limited to 10,000 entries; string lists to 128 strings of at most 128 characters each. The rules above may impose smaller limits. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors. A successfully returned false flag is an evaluated outcome; its meaning is explained above.
Alternative or Complementary methods
Use Auto Black/White Text Picker: Opaque background relative luminance determines black and white text contrast. The larger ratio is an objective choice within these two candidates. For a complementary task, use HSL Lightness Shift Percent: An additive HSL lightness shift uses percentage points rather than a brightness multiplier. Clipped values retain the source hue/saturation.
References
-
Dark-Mode Lightness Inversion Heuristic — tool.io
Similar or alternative tools
- Auto Black/White Text Picker
Opaque background relative luminance determines black and white text contrast. The larger ratio is an objective choice within these two candidates.
- HSL Lightness Shift Percent
An additive HSL lightness shift uses percentage points rather than a brightness multiplier. Clipped values retain the source hue/saturation.