RGB To Colorblind RGB Converter [Module] - [Supports many types of colorblindness]

Hello! I’ve made a RGB to colorblind RGB converter which can be helpful for you or for your game, this module brings support for many types of colorblindness that people in the real world have and have to deal with on a day to day basis and it’s not given much attention by developers but implementing support such as colorblind friendly color pallets or colorblind friendly user interfaces can make experience so much better for those who struggle with differentiating between two or more colors which can have very low contrast ratios which makes it hard to differentiate between other colors and some people can have troubles with colors such as red & green being used or mixed together as some might see more red than green or more green than red which can be frustrating for the person who’s colorblind, this does not mean that it’s just these two colors that could be causing problems it can range to many more, using two colors together is okay if one of them is not associated with CVD.

Please only use this appropriately, it’s recommended that you research on google on what colors you should look out for and not for the type of colorblindness.


Colorblindness types which are supported in this module

  1. Achromatopsia
  2. Achromatomaly
  3. Deuteranopia
  4. Deuteranomaly
  5. Protanopia
  6. Protanomaly
  7. Tritanopia
  8. Tritanomaly

Previous thread to where much was talked about this
Click here

RGB To Colorblind RGB Module
Click here

Game to see this in action
Click here


Usage and api documentation of module | Read before using
local ColorblindConverter = require(rgbToColorblindRgbModule) -- Make sure to define the module

local ColorblindRgbController = ColorblindConverter:colorblindType('Achromatopsia') -- Use the exact names provided in the supported list

local rgbValues = {255, 155, 0} -- The 'normal' rgb value we want converted to the colorblind rgb version

local ColorblindRgbHandler = ColorblindRgbController:convertRgb(unpack(rgbValues)) -- First argument is our variable 'rgbValues'

Now that’ all set up we can now use the method’s that are given to us from the module for ColorblindRgbHandler variable, it’s assigned to Achromatopsia in the code but you can always change that in the given list I’ve provided.

API for your Colorblind Rgb Handler

  • Property : Color3 - Color3 Instance
    ColorblindRgbHandler.Color3 --> Color3.new(?, ?, ?)

  • Property : RGB - Table
    ColorblindRgbHandler.RGB --> {R = ?, G = ?, B = ?}

  • Property : R - Number
    ColorblindRgbHandler.R --> R value from RGB

  • Property : G - Number
    ColorblindRgbHandler.G --> G value from RGB

  • Property : B - Number
    ColorblindRgbHandler.B --> B value from RGB


HSV API

toHSV - Function - Has it’s own api
local hsvHandler = ColorblindRgbHandler:toHSV()

  • Property : Hue - Number
    hsvHandler.Hue--> Hue value from RGB

  • Property : Saturation- Number
    hsvHandler.Saturation--> Saturationvalue from RGB

  • Property : Value- Number
    hsvHandler.Value--> HSV value from RGB

  • Property : HSV - Table
    hsvHandler.HSV --> {Hue = ?, Saturation = ?, Value = ?}


31 Likes

First off, I want to say that I think that accessibility in games are very important, but the way that you are doing it will rarely be the best option and will be tricky to get right, it is like a colorblind simulator and will rarely help. Dealing with colorblindness is a case by case basis. This video, by Game Maker’s Toolkit, explains how to deal with colorblindness and shows examples on how other, indie and AAA, dealt with colorblindness.

A tool that simulates color blindness will be useful for developers who want to help colorblind people with playing their game, as it will be easy to see if the solution works.

7 Likes

Hi there sorry for the late reply, as I’m uncertain of what accessibility you find unsatisfactory could you provide a list of what accessibility you find that could be changed?