1// Aseprite
2// Copyright (C) 2022 Igara Studio S.A.
3// Copyright (C) 2001-2018 David Capello
4//
5// This program is distributed under the terms of
6// the End-User License Agreement for Aseprite.
7
8#ifndef APP_UI_COLOR_SPECTRUM_H_INCLUDED
9#define APP_UI_COLOR_SPECTRUM_H_INCLUDED
10#pragma once
11
12#include "app/ui/color_selector.h"
13
14namespace app {
15
16 class ColorSpectrum : public ColorSelector {
17 public:
18 ColorSpectrum();
19
20 protected:
21#if SK_ENABLE_SKSL
22 const char* getMainAreaShader() override;
23 const char* getBottomBarShader() override;
24 void setShaderParams(SkRuntimeShaderBuilder& builder, bool main) override;
25#endif
26 app::Color getMainAreaColor(const int u, const int umax,
27 const int v, const int vmax) override;
28 app::Color getBottomBarColor(const int u, const int umax) override;
29 void onPaintMainArea(ui::Graphics* g, const gfx::Rect& rc) override;
30 void onPaintBottomBar(ui::Graphics* g, const gfx::Rect& rc) override;
31 void onPaintSurfaceInBgThread(os::Surface* s,
32 const gfx::Rect& main,
33 const gfx::Rect& bottom,
34 const gfx::Rect& alpha,
35 bool& stop) override;
36 int onNeedsSurfaceRepaint(const app::Color& newColor) override;
37
38 private:
39 std::string m_mainShader;
40 std::string m_bottomShader;
41 };
42
43} // namespace app
44
45#endif
46