mirror of
https://github.com/Theaninova/BeatLanguageMapper.git
synced 2026-01-19 08:22:56 +00:00
Mk2
uh stuff. i'm putting it in the readme.
This commit is contained in:
21
Source/MediocreMapper/ColorConverter.cpp
Normal file
21
Source/MediocreMapper/ColorConverter.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#include "ColorConverter.h"
|
||||
|
||||
int UColorConverter::ColortoInt(FLinearColor color)
|
||||
{
|
||||
int r = color.R * 255;
|
||||
int g = color.G * 255;
|
||||
int b = color.B * 255;
|
||||
return 2000000000+((r & 0xff) << 16) + ((g & 0xff) << 8) + (b & 0xff);
|
||||
}
|
||||
|
||||
FLinearColor UColorConverter::InttoColor(int color)
|
||||
{
|
||||
color = color - 2000000000;
|
||||
FLinearColor outColor;
|
||||
outColor.B = (float)(color & 0xFF)/0xFE;
|
||||
outColor.G = (float)(color >> 8 & 0xFF)/0xFE;
|
||||
outColor.R = (float)(color >> 16 & 0xFF)/0xFE;
|
||||
return outColor;
|
||||
}
|
||||
Reference in New Issue
Block a user