Agrarsense
ColorUtilities.h
Go to the documentation of this file.
1// Copyright (c) 2023 FrostBit Software Lab at the Lapland University of Applied Sciences
2//
3// This work is licensed under the terms of the MIT license.
4// For a copy, see <https://opensource.org/licenses/MIT>.
5
6#pragma once
7
8#include "CoreMinimal.h"
9#include "Kismet/BlueprintFunctionLibrary.h"
10
11
12#include "ColorUtilities.generated.h"
13
17UCLASS()
18class AGRARSENSE_API UColorUtilities : public UBlueprintFunctionLibrary
19{
20
21 GENERATED_BODY()
22
23public:
30 UFUNCTION(BlueprintCallable, Category = "Conversion")
31 static FLinearColor HexToLinearColor(const FString& HexString, bool& bSuccess);
32
39 UFUNCTION(BlueprintCallable, Category = "Conversion")
40 static FLinearColor RGBStringToLinearColor(const FString& ColorString, bool& bSuccess);
41
48 UFUNCTION(BlueprintPure, Category = "Color Utilities")
49 static FLinearColor AutoDetectColorStringToLinearColor(const FString& ColorString, bool& bSuccess);
50
52 UFUNCTION(BlueprintCallable, Category = "Conversion")
53 static FString LinearColorToHex(const FLinearColor& Color, bool bIncludeAlpha, bool bAddPrefix);
54
56 UFUNCTION(BlueprintCallable, Category = "Conversion")
57 static FString LinearColorToRGBString(const FLinearColor& Color, bool bIncludeAlpha);
58
64 UFUNCTION(BlueprintPure, Category = "Color Utilities")
65 static bool IsValidRGBString(const FString& ColorString);
66
72 UFUNCTION(BlueprintPure, Category = "Color Utilities")
73 static bool IsValidHexString(const FString& ColorString);
74};