Advertisement
Janilabo

Untitled

Oct 25th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.29 KB | None | 0 0
  1. var
  2.   b: Byte;
  3.  
  4. function ColorToGrayL(Color: Integer): Byte;
  5. begin
  6.   Result := Trunc((0.2126 * (Color and $FF)) +
  7.                   (0.7152 * ((Color shr 8) and $FF)) +
  8.                   (0.0722 * ((Color shr 16) and $FF)));
  9. end;
  10.  
  11. begin
  12.   b := ColorToGrayL(16777215);
  13.   WriteLn(B);
  14. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement