A modded EditSaber for making beat saber maps.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
591 B

5 years ago
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2. #include "ColorConverter.h"
  3. int UColorConverter::ColortoInt(FLinearColor color)
  4. {
  5. int r = color.R * 255;
  6. int g = color.G * 255;
  7. int b = color.B * 255;
  8. return 2000000000+((r & 0xff) << 16) + ((g & 0xff) << 8) + (b & 0xff);
  9. }
  10. FLinearColor UColorConverter::InttoColor(int color)
  11. {
  12. color = color - 2000000000;
  13. FLinearColor outColor;
  14. outColor.B = (float)(color & 0xFF)/0xFF;
  15. outColor.G = (float)(color >> 8 & 0xFF)/0xFF;
  16. outColor.R = (float)(color >> 16 & 0xFF)/0xFF;
  17. outColor.A = 1;
  18. return outColor;
  19. }