29#include <utility/graphic/color.hpp>
31#include "guillaume/motion/easing.hpp"
204 utility::graphic::Color32Bit
205 tint(
const utility::graphic::Color32Bit &surface,
206 const utility::graphic::Color32Bit &
tint,
382 return motion::Easing::Standard;
390 static constexpr motion::Easing
enter(
void)
392 return motion::Easing::EmphasizedDecelerate;
400 static constexpr motion::Easing
exit(
void)
402 return motion::Easing::EmphasizedAccelerate;
428 static constexpr float Unit = 4.0f;
441 static constexpr float get(
unsigned int steps)
443 return Unit *
static_cast<float>(steps);
472 static constexpr float Width = 3.0f;
void set(ElevationLevel level, const ElevationToken &token)
Replace the shadow and tint of a level.
const ElevationToken & get(ElevationLevel level) const
Get the shadow and tint of a level.
utility::graphic::Color32Bit tint(const utility::graphic::Color32Bit &surface, const utility::graphic::Color32Bit &tint, ElevationLevel level) const
Compute the color of a surface raised to a level: the tint color blended over the surface color at th...
ElevationScale(void)
Create the scale with the Material 3 baseline values.
static constexpr float IndeterminateCycle
Duration of one cycle of an indeterminate progress or loading indicator, in seconds (1....
static constexpr motion::Easing enter(void)
Get the easing for elements entering the screen: fast at first, then settling.
float getDuration(MotionDuration duration) const
Get the length of a duration token.
static constexpr float MaxFrameStep
Longest frame step the animation system integrates, in seconds, so a stalled frame does not skip a wh...
static constexpr motion::Easing standard(void)
Get the easing for elements that move or change while staying on screen.
void setDuration(MotionDuration duration, float seconds)
Replace the length of a duration token.
MotionScale(void)
Create the scale with the Material 3 baseline durations listed in MotionDuration.
static constexpr motion::Easing exit(void)
Get the easing for elements leaving the screen: slow at first, then speeding away.
static constexpr float SnackbarDuration
How long a snackbar stays visible by default, in seconds (7 s, as in react-native-paper).
ShapeScale(void)=default
Create a scale with DefaultRoundness.
static constexpr float DefaultRoundness
The roundness for which each role has the radius listed in ShapeRole.
float getRoundness(void) const
Get the roundness of the scale.
static constexpr float FullRadius
Radius returned for ShapeRole::Full, in dp. Renderers clamp radii to half the smallest extent,...
void setRoundness(float roundness)
Change the roundness, which rescales every role except None and Full.
float getRadius(ShapeRole role) const
Get the corner radius of a role for the current roundness.
Spacing constants: the 4 dp grid every margin and gap is a multiple of, and the minimum size of somet...
static constexpr float Unit
Base grid unit, in dp.
static constexpr float MinTouchTarget
Smallest width and height an interactive control should offer to a pointer or a finger,...
static constexpr float get(unsigned int steps)
Get a spacing as a number of grid units.
static constexpr float touchMargin(float extent)
Get the invisible margin that makes a small control as easy to hit as MinTouchTarget.
void setOpacity(StateLayer layer, float opacity)
Replace the opacity of a state layer.
std::uint8_t getAlpha(StateLayer layer) const
Get the opacity of a state layer as an alpha channel value.
StateLayerScale(void)
Create the scale with the Material 3 baseline opacities.
float getOpacity(StateLayer layer) const
Get the opacity of a state layer.
Design tokens: colors, type scale, shapes, elevation, motion and spacing. Read them through guillaume...
ElevationLevel
How far a surface is raised above the background, in six steps.
@ Level2
Second raised level.
@ Level1
Lowest raised level.
@ Level3
Third raised level.
@ Level5
Highest raised level.
@ Level0
Flat: no shadow, no tint.
@ Level4
Fourth raised level.
@ Count
Number of levels; not a level.
StateLayer
The interaction states that change how a widget is drawn.
@ Hovered
0.08 overlay of the content color.
@ Dragged
0.16 overlay of the content color.
@ DisabledContainer
0.12 opacity of onSurface containers.
@ Focused
0.12 overlay of the content color.
@ Pressed
0.12 overlay of the content color.
@ DisabledContent
0.38 opacity of onSurface content.
@ Count
Number of states; not a state.
MotionDuration
The named animation lengths of Material Design 3. The values given are the defaults.
@ Count
Number of tokens; not a token.
ShapeRole
The corner radii a widget can ask for, by name.
@ ExtraLarge
28 dp (dialogs, search bars, sheets).
@ Large
16 dp (FABs, drawers).
@ None
0 dp: square corners.
@ Full
Fully rounded (buttons, icon buttons, badges).
@ ExtraSmall
4 dp (text fields, menus, snackbars).
@ Count
Number of roles; not a role.
What one elevation level looks like: how much the surface is tinted and how large and dark its shadow...
std::uint8_t shadowAlpha
Opacity of the shadow where it is darkest, 0 to 255.
Dimensions of the ring drawn around the entity that has the keyboard focus.
static constexpr float Width
Ring thickness, in dp.
static constexpr float Offset
Gap between the bound and the ring, in dp.