Skip to content

Commit

Permalink
[#231] [NF] BrandBook and Custom Theme. Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lyskouski committed Sep 15, 2023
1 parent 4cc748a commit f70feaa
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ \subsubsection{Android: loading screen and icons}

\subsubsection{Linux: icons}

Before the line \q{gtk_widget_show(GTK_WIDGET(window));} add the next:
Before the line \q{gtk\_widget\_show(GTK\_WIDGET(window));} add the next:

\begin{lstlisting}
// ./linux/my_application.cc
Expand Down
76 changes: 76 additions & 0 deletions docs/implementation-flow/ch06-s01-styling.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
% Copyright 2023 The terCAD team. All rights reserved.
% Use of this content is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file.

\subsection{Branding Palette}
\markboth{Optimizing UI/UX Flow}{Branding Palette}

A Branding Palette, often referred to as a Color Palette, is a thoughtfully curated selection of colors that reflect the
brand's personality, values, and objectives. It declares Primary (dominate the visual identity) and Secondary
(complement the primary colors) Colors, Typography (fonts and typography styles), and Imagery (guidelines for images
and icons selection or creation). Mostly, the palette is included into a Brand Book \cite{Geyr16}, also known as a
Brand Style Guide or Brand Guidelines, that provides in-depth guidance on how a brand's visual identity should be
applied consistently across all touchpoints. It serves as a reference manual for designers, marketers, and anyone
involved in representing the brand.

In a context of Flutter applications, the palette is defined for \q{MaterialApp}-widget via \q{colorScheme} and
\q{floatingActionButtonTheme} properties, and, instead of fully declared color scheme, we might take a default one
by overriding valuable for us colors:

\begin{lstlisting}
// ./lib/main.dart
return MaterialApp(
theme: ThemeData(
colorScheme: const ColorScheme.light().withCustom(),
floatingActionButtonTheme: const FloatingActionButtonThemeData().withCustom(Brightness.light),
// ... other options
),
darkTheme: ThemeData(
colorScheme: const ColorScheme.dark().withCustom(),
floatingActionButtonTheme: const FloatingActionButtonThemeData().withCustom(Brightness.dark),
\end{lstlisting}

\noindent Where \q{withCustom}-method is a part of our extension for \q{ColorScheme} and \q{FloatingActionButtonThemeData}:

\begin{lstlisting}
// ./lib/_configs/custom_color_scheme.dart
class AppColors {
late AppDefaultColors palette;
// Choose palette from brightness condition
AppColors(Brightness brightness) {
if (brightness == Brightness.dark) {
palette = AppDarkColors();
} else {
palette = AppDefaultColors();
}
}
}
// Light mode
class AppDefaultColors {
Color get primary => const Color(0xff912391);
// ... other options
}
// Dark mode
class AppDarkColors implements AppDefaultColors {
// ... other options
}

extension CustomColorScheme on ColorScheme {
ColorScheme withCustom() {
final palette = AppColors(brightness).palette;
return copyWith(
primary: palette.primary,
//... other options
);
}
}

extension CustomButtonTheme on FloatingActionButtonThemeData {
FloatingActionButtonThemeData withCustom(Brightness brightness) {
final palette = AppColors(brightness).palette;
return copyWith(
backgroundColor: palette.inversePrimary,
foregroundColor: palette.onButton,
);
}
}
\end{lstlisting}
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,5 @@ \subsection{Using Autofocus}
\end{lstlisting}

And finally, let's refactor taken solution to make it reliable, by storing positions during components initialization
and making a delta scroll by their deduction (positions of the current element and the first one) - \issue{164}{}.
and making a delta scroll by their deduction (positions of the current element and the first one) -- \issue{164}{},
\issue{265}{172eb11}.
7 changes: 4 additions & 3 deletions docs/implementation-flow/index.tex
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ \section{Unleashing Features}

\newpage
\section{[WIP] Optimizing UI/UX Flow}
\input{./ch06-s01-autofocus}
\input{./ch06-s02-adaptive}
\input{./ch06-s03-experience}
\input{./ch06-s01-styling}
\input{./ch06-s02-autofocus}
\input{./ch06-s03-adaptive}
\input{./ch06-s04-experience}

\newpage
\section{[TBD] Reaching Production-Ready Stage}
Expand Down
1 change: 1 addition & 0 deletions docs/implementation-flow/references.tex
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
\bibitem[Boeh88]{Boeh88} Barry W. Boehm, Philip N. Papaccio ``Understanding and Controlling Software Costs”,
\emph{IEEE Transactions on Software Engineering, v. 14, no. 10, pp. 1462-1477}, DOI 10.1109/32.6191, October 1988
\bibitem[Geyr16]{Geyr16} Fabian Geyrhalter, ``How to Launch a Brand", \emph{Brandtro}, ISBN 9780989646130, June 2016
\end{thebibliography}

0 comments on commit f70feaa

Please sign in to comment.