summaryrefslogtreecommitdiff
path: root/Libraries/LibHTML/CSS/StyleValue.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-29 18:05:37 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-29 18:05:37 +0200
commit37a37accd41154691f82c9564dad6651bc0c07ec (patch)
tree008f2af61721fa8f4bf5a6dd90d7c65ba939143d /Libraries/LibHTML/CSS/StyleValue.h
parenta4fccc02ecb1a956edd98fc25e335bb7e4905bb1 (diff)
downloadserenity-37a37accd41154691f82c9564dad6651bc0c07ec.zip
LibHTML: Implement basic support for background-color
Diffstat (limited to 'Libraries/LibHTML/CSS/StyleValue.h')
-rw-r--r--Libraries/LibHTML/CSS/StyleValue.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibHTML/CSS/StyleValue.h b/Libraries/LibHTML/CSS/StyleValue.h
index 02dd2a1cc0..5dd8e2cc1c 100644
--- a/Libraries/LibHTML/CSS/StyleValue.h
+++ b/Libraries/LibHTML/CSS/StyleValue.h
@@ -24,9 +24,11 @@ public:
bool is_inherit() const { return type() == Type::Inherit; }
bool is_initial() const { return type() == Type::Initial; }
+ bool is_color() const { return type() == Type::Color; }
virtual String to_string() const = 0;
virtual Length to_length() const { return {}; }
+ virtual Color to_color() const { return {}; }
virtual bool is_auto() const { return false; }
@@ -120,6 +122,7 @@ public:
Color color() const { return m_color; }
String to_string() const override { return String::format("COLOR: %s", m_color.to_string().characters()); }
+ Color to_color() const override { return m_color; }
private:
explicit ColorStyleValue(Color color)