From f3af6c7e5b46f4209a4981e5d7be217368f40b15 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 8 Feb 2024 15:12:29 +0800 Subject: Get rid of GSL. --- src/platform/Color.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/platform/Color.cpp') diff --git a/src/platform/Color.cpp b/src/platform/Color.cpp index a35ef535..bbb78628 100644 --- a/src/platform/Color.cpp +++ b/src/platform/Color.cpp @@ -1,7 +1,5 @@ #include "cru/platform/Color.h" -#include - #include #include #include @@ -61,9 +59,8 @@ std::optional Color::Parse(StringView string, if (!g) return std::nullopt; auto b = get_num_for_two_digit(string.substr(5, 2)); if (!b) return std::nullopt; - return Color(gsl::narrow_cast(*r), - gsl::narrow_cast(*g), - gsl::narrow_cast(*b)); + return Color(static_cast(*r), static_cast(*g), + static_cast(*b)); } else if (string_size == 9) { if (string[0] != u'#') return std::nullopt; auto r = get_num_for_two_digit(string.substr(1, 2)); @@ -74,9 +71,8 @@ std::optional Color::Parse(StringView string, if (!b) return std::nullopt; auto a = get_num_for_two_digit(string.substr(7, 2)); if (!a) return std::nullopt; - return Color( - gsl::narrow_cast(*r), gsl::narrow_cast(*g), - gsl::narrow_cast(*b), gsl::narrow_cast(*a)); + return Color(static_cast(*r), static_cast(*g), + static_cast(*b), static_cast(*a)); } else { return std::nullopt; } -- cgit v1.2.3