TextWindow
Nella finestra di testo è immediato utilizzare i 16 colori con nome
Black | Blue | Cyan | Gray | Green | Magenta | Red | White | Yellow |
— | DarkBlue | DarkCyan | DarkGray | DarkGreen | DarkMagenta | DarkRed | — | DarkYellow |
Per scrivere del testo di un certo colore (e con lo sfondo nero)
1 |
TextWindow.ForegroundColor="DarkRed" |
Per scrivere del testo di un certo colore (e con lo sfondo a piacere…)
1 2 |
TextWindow.BackgroundColor="White" TextWindow.ForegroundColor="DarkRed" |
Per cambiare il colore di fondo della finestra
1 2 |
TextWindow.BackgroundColor="White" TextWindow.Clear() |
GraphicsWindow
Nella finestra grafica si possono richiamare gli stessi colori della finestra di testo
oppure i numerosi colori con nome come: Brown, Crimson, FireBrick, Gold, IndianRed, Khaki, LemonChiffon, LightCoral, Navy, Salmon, …
1 2 3 |
GraphicsWindow.BackgroundColor="Aqua" GraphicsWindow.BrushColor ="Navy" GraphicsWindow.PenColor ="Brown" |
RGB – Tripla esadecimale
Un colore può essere specificato tramite un codice RGB
1 |
GraphicsWindow.PenColor = "#FF0000" |
Con
- R (Red) = 00 … FF
- G (Green) = 00 … FF
- B (Blue) = 00 … FF
- RGB = “#000000” … “#FFFFFF“
RGB – Tripla di interi
Un colore può essere specificato tramite una tripla di interi
1 |
GraphicsWindow.PenColor = GraphicsWindow.GetColorFromRGB(255,0,0) |
Con
- R (Red) = 0 … 255
- G (Green) = 0 … 255
- B (Blue) = 0 … 255
- RGB = (0, 0, 0) … (255, 255, 255)
ARGB – Con trasparenza
Un colore RGB diventa ARGB, trasparente, aggiungendo una coppia esadecimale iniziale
1 |
GraphicsWindow.PenColor = "#80FF0000" |
Con
- A (Alpha) = 00 … FF
- R (Red) = 00 … FF
- G (Green) = 00 … FF
- B (Blue) = 00 … FF
- ARGB = “#0000000″ … “#FFFFFFF”