Spaces:
Sleeping
Sleeping
change colors
#8
by
maettubfh
- opened
src/nlp_circle_demo/bfh_theme.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gradio.themes.base import Base
|
3 |
+
from gradio.themes.utils import colors, fonts, sizes
|
4 |
+
|
5 |
+
|
6 |
+
bfh_blue = colors.Color(
|
7 |
+
c50="#edf0f2",
|
8 |
+
c100="#dbe0e5",
|
9 |
+
c200="#b7c1cb",
|
10 |
+
c300="#93a2b1",
|
11 |
+
c400="#6f8397",
|
12 |
+
c500="#4b647d",
|
13 |
+
c600="#3c5064",
|
14 |
+
c700="#2d3c4b",
|
15 |
+
c800="#1e2832",
|
16 |
+
c900="#0f1419",
|
17 |
+
c950="#070a0c",
|
18 |
+
name="bfh_blue",
|
19 |
+
)
|
20 |
+
|
21 |
+
bfh_yellow = colors.Color(
|
22 |
+
c50="#fff9e6",
|
23 |
+
c100="#fef3cc",
|
24 |
+
c200="#fde799",
|
25 |
+
c300="#fcdb66",
|
26 |
+
c400="#fbcf33",
|
27 |
+
c500="#fac300",
|
28 |
+
c600="#c89c00",
|
29 |
+
c700="#967500",
|
30 |
+
c800="#644e00",
|
31 |
+
c900="#322700",
|
32 |
+
c950="#191300",
|
33 |
+
name="bfh_yellow",
|
34 |
+
)
|
35 |
+
|
36 |
+
|
37 |
+
class BFHTheme(Base):
|
38 |
+
def __init__(
|
39 |
+
self,
|
40 |
+
):
|
41 |
+
super().__init__(
|
42 |
+
primary_hue=bfh_blue,
|
43 |
+
secondary_hue=bfh_yellow,
|
44 |
+
)
|
src/nlp_circle_demo/wrapped_gradio_objects.py
CHANGED
@@ -2,6 +2,8 @@ import gradio as gr
|
|
2 |
import yaml
|
3 |
import os
|
4 |
|
|
|
|
|
5 |
|
6 |
class WrappedGradioObject:
|
7 |
def __init__(self, title, gradio_element):
|
@@ -55,6 +57,7 @@ class GradioTabWrapper(WrappedGradioObject):
|
|
55 |
interface = gr.TabbedInterface(
|
56 |
[obj.gradio_element for obj in gradio_objects],
|
57 |
[obj.title for obj in gradio_objects],
|
|
|
58 |
)
|
59 |
return cls(title, interface)
|
60 |
|
|
|
2 |
import yaml
|
3 |
import os
|
4 |
|
5 |
+
from src.nlp_circle_demo.bfh_theme import BFHTheme
|
6 |
+
|
7 |
|
8 |
class WrappedGradioObject:
|
9 |
def __init__(self, title, gradio_element):
|
|
|
57 |
interface = gr.TabbedInterface(
|
58 |
[obj.gradio_element for obj in gradio_objects],
|
59 |
[obj.title for obj in gradio_objects],
|
60 |
+
theme=BFHTheme(),
|
61 |
)
|
62 |
return cls(title, interface)
|
63 |
|