Hey so this is LITERALLY being written right after Roblox just announced the new Color3 contrast & luminance methods, but as someone with a mild red-green color deficiency, I was thinking there could now be a genuine case for supporting color vision deficiencies directly through Color3.
The new methods are great for checking contrast and readability, but thereβs still the issue of colors that look completely different to one person being practically indistinguishable to someone else.
ππ πΆ π ππ·πππ πΉππππππ ππ[1], itβs currently rather annoying to actually test for this without relying on external tools or implementing the color transformations yourself.
Proposed Methods
Color3:SimulateColorVisionDeficiency()
Color3:SimulateColorVisionDeficiency(
visionType: Enum.ColorVisionDeficiency,
severity: number?
): Color3
Pretty self-explanatory (I hope), this would return a Color3 approximating how the original color would appear to someone with a particular color vision deficiency.
Ideally, itβd support the different types, I might be naming these wrong but
- Protanopia
- Deuteranopia
- Tritanopia
- Achromatopsia
- etc
Color3:GetPerceptualDifference()
Color3:GetPerceptualDifference(
other: Color3,
visionType: Enum.ColorVisionDeficiency?
): number
This one would be for comparing two colors based on how distinguishable they actually are, optionally accounting for a particular color vision deficiency.
Iβm not entirely sure what the best measurement would be here, but ideally the returned number would follow some sort of documented perceptual difference metric, so developers could establish their own thresholds for how distinguishable two colors should be.
Having some sort of perceptual difference calculation would make it easier to identify potentially problematic color combinations without having to visually inspect every single one. Still, having these capabilities built into the engine would make testing for these issues considerably easier, especially now that Color3 is already getting accessibility-related functionality.
I just think itβd be a pretty natural extension of what was announced today.
sorry just had to add the fancy text β©οΈ
I included
severityas an optional value between0and1, although please donβt treat that as being necessary specifically. It just seems like it could make sense for the logic being done, especially if there were some sort of UI slider hooked up to it. β©οΈ