Skip to main content

How to make an RGB Colour lighter ?

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

If you want to make an colour expressed in Red Green Blue (as in the GUI Class Library) then you cannot simply subtract a value from each of the RGB values.

Resolution:

To make an RGB  lighter you first need to convert and RGB value to a H S L value. This is Hue Saturation and Light, and is an alternate way of expressing a colour numerically. The L can then then be altered to lighten the colour, and then HSL can be converted back to RGB.

There are well know algorithms to do this, and I have attached a COBOL implementation to this KB Item.

Attachments:

RGBtoHSL.cbl

Old KB# 7080