mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibDraw: Add Color::from_string(StringView)
This parses hex colors in either #RRGGBBAA or #RRGGBB format. No other formats are supported at the moment.
This commit is contained in:
parent
f511421aaa
commit
e43b27a3fa
2 changed files with 43 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/Types.h>
|
||||
|
||||
typedef u32 RGBA32;
|
||||
|
@ -132,6 +133,7 @@ public:
|
|||
}
|
||||
|
||||
String to_string() const;
|
||||
static Optional<Color> from_string(const StringView&);
|
||||
|
||||
private:
|
||||
explicit Color(RGBA32 rgba)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue