mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
LibGfx: Make Color hashable
This commit is contained in:
parent
272cd30f17
commit
02e682950e
Notes:
sideshowbarker
2024-07-17 02:42:21 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/02e682950e Pull-request: https://github.com/SerenityOS/serenity/pull/24330 Reviewed-by: https://github.com/nico ✅
@ -621,6 +621,15 @@ using Gfx::Color;
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<>
|
||||
class Traits<Color> : public DefaultTraits<Color> {
|
||||
public:
|
||||
static unsigned hash(Color const& color)
|
||||
{
|
||||
return int_hash(color.value());
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct Formatter<Gfx::Color> : public Formatter<StringView> {
|
||||
ErrorOr<void> format(FormatBuilder&, Gfx::Color);
|
||||
|
Loading…
Reference in New Issue
Block a user