File tree Expand file tree Collapse file tree
app/src/main/java/de/mide/android/komplementaerfarben Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package de .mide .android .komplementaerfarben ;
22
3+ import static de .mide .android .komplementaerfarben .MainActivity .TAG4LOGGING ;
4+
35import android .util .Log ;
46
57import androidx .lifecycle .ViewModel ;
@@ -28,7 +30,7 @@ public class ZweiFarbenViewModel extends ViewModel {
2830 */
2931 public ZweiFarbenViewModel () {
3032
31- Log .i ( MainActivity . TAG4LOGGING , "ViewModel erzeugt" );
33+ Log .i ( TAG4LOGGING , "ViewModel erzeugt" );
3234 }
3335
3436
@@ -52,7 +54,7 @@ public boolean farbenNochNichtErzeugt() {
5254 *
5355 * @param blau Blau-Anteil von 0..255
5456 *
55- * @return RGB-Farbcode als ein int-Wert, mit voller Deckkraft
57+ * @return RGB-Farbcode als ein int-Wert, mit voller Deckkraft (Alpha-Wert=255)
5658 */
5759 private int rotGruenBlauZuRGB ( int rot , int gruen , int blau ) {
5860
@@ -76,9 +78,11 @@ public void neueFarbenErzeugen() {
7678
7779 _farbe1 = rotGruenBlauZuRGB ( rot1 , gruen1 , blau1 );
7880
81+
7982 int rot2 = 255 - rot1 ;
8083 int gruen2 = 255 - gruen1 ;
8184 int blau2 = 255 - blau1 ;
85+
8286 _farbe2 = rotGruenBlauZuRGB ( rot2 , gruen2 , blau2 );
8387 }
8488
You can’t perform that action at this time.
0 commit comments