TColorToRGB/de: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: TColorToRGB/de
| Old | New | Line | |
|---|---|---|---|
| 1 | + | Zurück zur Seite [[code examples/de|Code Beispiele]]. | |
| 2 | + | ||
| 3 | + | Wandelt Datentyp TColor in RGB-Farbwerte um. | |
| 4 | + | ||
| 5 | + | Die maximalen Werte von RGB sind 255, 255, 255. Das Ergebnis ist die Farbe Weiss.\ | |
| 6 | + | Die minimalen Werte von RGB sind 0, 0, 0. Das Ergebnis ist die Farbe Schwarz.\ | |
| 7 | + | ||
| 8 | + | ``` pascal | |
| 9 | + | uses | |
| 10 | + | Graphics, Windows, ...; | |
| 11 | + | ||
| 12 | + | ... | |
| 13 | + | ||
| 14 | + | procedure subTColorToRGB(Color: TColor; out bytR: byte; out bytG: byte; out bytB: byte); | |
| 15 | + | begin | |
| 16 | + | if Color shr 24 = $FF then | |
| 17 | + | Color := GetSysColor(Color and $FF) | |
| 18 | + | else if Color shr 24 > $02 then | |
| 19 | + | Color := 0; | |
| 20 | + | ||
| 21 | + | bytR := Color; | |
| 22 | + | bytG := (Color shr 8); | |
| 23 | + | bytB := (Color shr 16); | |
| 24 | + | end; | |
| 25 | + | ||
| 26 | + | ... | |
| 27 | + | ``` | |
| 28 | + | ||
| 29 | + | --- | |
| 30 | + | *From the Free Pascal wiki, page "TColorToRGB/de", as it stood on 2020-02-29 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 31 | + | Category: Code Snippets/de | |
| 32 | + | Category: Color/de | |
| 33 | + | Category: Deutsch |
