-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsporkl_gui.h
80 lines (66 loc) · 2.54 KB
/
sporkl_gui.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*******************************************************************************
BEGIN_JUCE_MODULE_DECLARATION
ID: sporkl_gui
vendor: sporklpony
version: 0.1
name: Sporkl Look and Feel
description: Custom look and feel for personal projects.
dependencies: juce_graphics juce_gui_basics
website: htttps://dmitrivolkov.com
END_JUCE_MODULE_DECLARATION
*******************************************************************************/
#pragma once
#define SPORKL_GUI_INCLUDED
// generated by BinaryBuilder in JUCE extras
#include "sporkl_gui_latoregular.h"
// format: alpha, r, g, b 0xaarrggbb
const int LIGHT_COLOR = 0xffe6e1dc;
const int DARK_COLOR = 0xff2b2b2b;
const int ACCENT_COLOR = 0xffa6c166;
const int OTHER_COLOR = 0xff77bbdd;
class LookAndFeel_Sporkl : public juce::LookAndFeel_V4
{
public:
LookAndFeel_Sporkl(bool dark)
{
// handle font
auto latoRegular = juce::Typeface::createSystemTypefaceFor(LatoRegular::latoregular_ttf, LatoRegular::latoregular_ttfSize);
setDefaultSansSerifTypeface(latoRegular);
// handle color scheme
if (!dark)
{ // light color scheme
// handle color scheme
setColourScheme({
LIGHT_COLOR, // windowBackground
LIGHT_COLOR, // widgetBackground
LIGHT_COLOR, // menuBackground
DARK_COLOR, // outline
DARK_COLOR, // defaultTex
ACCENT_COLOR, // defaultFill
DARK_COLOR, // highlightedText
ACCENT_COLOR, // highlightedFill
DARK_COLOR // menuText
});
setColour(juce::Slider::backgroundColourId, juce::Colour(DARK_COLOR));
}
else
{ // dark color scheme
setColourScheme({
DARK_COLOR, // windowBackground
DARK_COLOR, // widgetBackground
DARK_COLOR, // menuBackground
LIGHT_COLOR, // outline
LIGHT_COLOR, // defaultTex
ACCENT_COLOR, // defaultFill
LIGHT_COLOR, // highlightedText
ACCENT_COLOR, // highlightedFill
LIGHT_COLOR // menuText
});
setColour(juce::Slider::backgroundColourId, juce::Colour(LIGHT_COLOR));
setColour(juce::Slider::rotarySliderOutlineColourId, juce::Colour(LIGHT_COLOR));
}
};
LookAndFeel_Sporkl()
: LookAndFeel_Sporkl(false) { };
~LookAndFeel_Sporkl() { };
};