aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/sksg/paint/SkSGColor.h
blob: a19921cfd34a6f95cc29c50e096b74389398b2b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Copyright 2017 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkSGColor_DEFINED
#define SkSGColor_DEFINED

#include "SkSGPaintNode.h"

#include "SkColor.h"

namespace sksg {

/**
 * Concrete Paint node, wrapping an SkColor.
 */
class Color : public PaintNode {
public:
    static sk_sp<Color> Make(SkColor c) { return sk_sp<Color>(new Color(c)); }

    SG_ATTRIBUTE(Color, SkColor, fColor)

protected:
    void onApplyToPaint(SkPaint*) const override;

private:
    explicit Color(SkColor);

    SkColor fColor;
};

} // namespace sksg

#endif // SkSGColor_DEFINED