neteja cppcheck (105 → 0)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#define _USE_MATH_DEFINES
|
||||
#include "utils/color.hpp"
|
||||
|
||||
#include <algorithm> // Para ranges::any_of
|
||||
#include <cctype> // Para isxdigit
|
||||
#include <cmath> // Para sinf, fmaxf, fminf, M_PI, fmodf, roundf, fmod
|
||||
#include <cstdint> // Para uint8_t
|
||||
@@ -22,10 +23,8 @@ auto Color::fromHex(const std::string& hex_str) -> Color {
|
||||
}
|
||||
|
||||
// Verificar que todos los caracteres sean hexadecimales válidos
|
||||
for (char c : hex) {
|
||||
if (std::isxdigit(c) == 0) {
|
||||
throw std::invalid_argument("String contiene caracteres no hexadecimales");
|
||||
}
|
||||
if (std::ranges::any_of(hex, [](char c) { return std::isxdigit(c) == 0; })) {
|
||||
throw std::invalid_argument("String contiene caracteres no hexadecimales");
|
||||
}
|
||||
|
||||
// Convertir cada par de caracteres a valores RGB(A)
|
||||
|
||||
Reference in New Issue
Block a user