"lightening" a color

Scott Rossi scott at tactilemedia.com
Sat Sep 10 21:31:41 EDT 2016


Here's a tint function from way back.  pRGB is an RGB triplet, pValue is a
decimal percent value for the desired tint of the color.

function colorTint pRGB, pValue
   -- pRGB is RGB triplet
   -- pValue is between 0 and 1
   put pRGB into theTint
   repeat with N = 1 to 3
      put item N of pRGB into theColorItem
      put round ((1- pValue) * theColorItem + (pValue * 255)) into item N
of theTint
   end repeat
   return theTint
end colorTint




Regards,

Scott Rossi
Creative Director
Tactile Media, UX/UI Design




On 9/10/16, 3:00 PM, "use-livecode on behalf of Dr. Hawkins"
<use-livecode-bounces at lists.runrev.com on behalf of dochawk at gmail.com>
wrote:

>I am adding the ability to have multiple clients open, and want to use
>colors as a cue.
>
>Is there a way to "lighten" a color.  That is (I suppose), to grab the
>numeric representation, and convert that to a much paler shade of the
>color?
>
>-- 
>Dr. Richard E. Hawkins, Esq.
>(702) 508-8462
>_______________________________________________
>use-livecode mailing list
>use-livecode at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-livecode






More information about the use-livecode mailing list