Получить оттенок серого из RGB-цвета

Советы » Цвета и Палитра » Получить оттенок серого из RGB-цвета

{ 
  The following function helps you to convert a RGB Color to Grayscale. 
  It works after the american NTSC (National Televisision Standards Committee) 
  system. 
}

 { 
  Mit Hilfe des folgenden Codes lasst sich die Graustufe einer 
  beliebigen RGB Farbe herausfinden. Das System arbeitet nach dem 
  vom amerikanischem NTSC (National Televisision Standards Committee) 
  vorgelschlagenem System. 
  Es kann unteranderem dazu verwendet werden ein Bild in Graustufen 
  darzustellen. (siehe dazu Tipp http://www.swissdelphicenter.ch/de/showcode.php?id=437) 
}


 function

GetGreyScale(red, blue, green: TColor): TColor; var

Color: Integer; begin

Color := Round(red * 0.56 + green * 0.33 + blue * 0.11); Result := RGB(Color, Color, Color); end

;

Другое по теме:

Категории

Статьи

Советы

Copyright © 2023 - All Rights Reserved - www.delphirus.com