Einzelnen Beitrag anzeigen

knaeuel

Registriert seit: 2. Jul 2007
110 Beiträge
 
Delphi 10.3 Rio
 
#10

AW: [FMX, iOS] TAlphaColor Farbvergleiche falsch (nur iOS)

  Alt 22. Okt 2018, 12:46
irgendwas mit den datentypen macht ios da jedenfalls anders.

ich habe mal ganz ketzerisch den farbwert in einen integer geschrieben und siehe da, die case-anweisung funzt damit mit ios

Delphi-Quellcode:
...
var farbwert:integer;
...

    farbwert:=Acol;

    case farbwert of
        TAlphaColorRec.Red : Result := TAlphaColorRec.Fuchsia;
        TAlphaColorRec.Fuchsia : Result := TAlphaColorRec.Blue;
        TAlphaColorRec.Blue : Result := TAlphaColorRec.Darkblue;
        TAlphaColorRec.Darkblue : Result := TAlphaColorRec.Lightblue;
        TAlphaColorRec.Lightblue : Result := TAlphaColorRec.Green;
        TAlphaColorRec.Green : Result := TAlphaColorRec.Darkgreen;
        TAlphaColorRec.Darkgreen : Result := TAlphaColorRec.Lightgreen;
        TAlphaColorRec.Lightgreen : Result := TAlphaColorRec.Cyan;
        TAlphaColorRec.Cyan : Result := TAlphaColorRec.Purple;
        TAlphaColorRec.Purple : Result := TAlphaColorRec.Orangered;
        TAlphaColorRec.Orangered : Result := TAlphaColorRec.Red;
        else
                                    Result := TAlphaColorRec.Red;
    end;
Wolfgang
  Mit Zitat antworten Zitat