| 1074 | } |
| 1075 | |
| 1076 | FColor ReadColor(const TSharedPtr<FJsonObject>& Req, const FColor Default = FColor::Yellow) |
| 1077 | { |
| 1078 | FVector Rgb; |
| 1079 | if (!ReadVec3(Req, TEXT("color"), Rgb, FVector(Default.R / 255.0, Default.G / 255.0, Default.B / 255.0))) |
| 1080 | return Default; |
| 1081 | return FColor( |
| 1082 | (uint8)FMath::Clamp((int32)(Rgb.X * 255.0), 0, 255), |
| 1083 | (uint8)FMath::Clamp((int32)(Rgb.Y * 255.0), 0, 255), |
| 1084 | (uint8)FMath::Clamp((int32)(Rgb.Z * 255.0), 0, 255), |
| 1085 | 255); |
| 1086 | } |
| 1087 | |
| 1088 | /** Translate wire ttl into (bPersistent, LifeTime) pair UE's DrawDebug* |
| 1089 | * helpers expect. ttl > 0: bPersistent=true, lifetime=ttl (auto-expires). |
no test coverage detected