Skip to content

Commit

Permalink
feat: Add set_dark_mode and set_light_mode, closes #46
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Jul 5, 2023
1 parent e94ffaa commit eed90b0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
=========

0.3.11 (2023-07-04)
-------------------

Added
~~~~~

- :func:`~ocdskingfishercolab.set_dark_mode`, if *Tools > Settings > Site > Theme* is set to *dark* in Google Colaboratory.
- :func:`~ocdskingfishercolab.set_light_mode`, for the default Seaborn theme.

0.3.10 (2023-02-03)
-------------------

Expand Down
17 changes: 17 additions & 0 deletions ocdskingfishercolab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import os
import textwrap
import seaborn as sns
import warnings
from urllib.parse import urljoin

Expand Down Expand Up @@ -573,6 +574,22 @@ def get_condition(table, pointer, mode):
return get_ipython().run_cell_magic("sql", "", sql)


def set_dark_mode():
sns.set_style('dark', {
'figure.facecolor': '#383838',
'axes.edgecolor': '#d5d5d5',
'axes.facecolor': '#383838',
'axes.labelcolor': '#d5d5d5',
'text.color': '#d5d5d5',
'xtick.color': '#d5d5d5',
'ytick.color': '#d5d5d5',
})


def set_light_mode():
sns.set_theme()


class OCDSKingfisherColabError(Exception):
"""Base class for exceptions from within this package"""

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ install_requires =
oauth2client
pydrive2
requests
seaborn
sqlalchemy<2

[options.packages.find]
Expand Down

0 comments on commit eed90b0

Please sign in to comment.