[][src]Module nannou::prelude

A collection of commonly used items that we recommend importing for ease of use.

Re-exports

pub use crate::app;
pub use crate::app::App;
pub use crate::app::LoopMode;
pub use crate::color::hsl;
pub use crate::color::hsla;
pub use crate::color::hsv;
pub use crate::color::hsva;
pub use crate::color::lin_srgb;
pub use crate::color::lin_srgba;
pub use crate::color::rgb;
pub use crate::color::rgba;
pub use crate::color::srgb;
pub use crate::color::srgba;
pub use crate::color::Rgb;
pub use crate::color::Rgba;
pub use crate::event::WindowEvent::*;
pub use crate::event::AxisMotion;
pub use crate::event::Event;
pub use crate::event::TouchEvent;
pub use crate::event::TouchpadPressure;
pub use crate::event::Update;
pub use crate::event::WindowEvent;
pub use crate::frame::Frame;
pub use crate::frame::RawFrame;
pub use crate::frame::ViewFbo;
pub use crate::frame::ViewFramebufferObject;
pub use crate::geom;
pub use crate::geom::pt2;
pub use crate::geom::pt3;
pub use crate::geom::vec2;
pub use crate::geom::vec3;
pub use crate::geom::vec4;
pub use crate::geom::Cuboid;
pub use crate::geom::Point2;
pub use crate::geom::Point3;
pub use crate::geom::Rect;
pub use crate::geom::Vector2;
pub use crate::geom::Vector3;
pub use crate::geom::Vector4;
pub use crate::io::load_from_json;
pub use crate::io::load_from_toml;
pub use crate::io::safe_file_save;
pub use crate::io::save_to_json;
pub use crate::io::save_to_toml;
pub use crate::math::clamp;
pub use crate::math::deg_to_rad;
pub use crate::math::fmod;
pub use crate::math::map_range;
pub use crate::math::partial_max;
pub use crate::math::partial_min;
pub use crate::math::rad_to_deg;
pub use crate::math::rad_to_turns;
pub use crate::math::turns_to_rad;
pub use crate::rand::random_f32;
pub use crate::rand::random_f64;
pub use crate::rand::random_range;
pub use crate::text;
pub use crate::text::text;
pub use crate::time::DurationF64;
pub use crate::ui;
pub use crate::vk;
pub use crate::vk::DynamicStateBuilder;
pub use crate::window;

Modules

bounds
cast
float
identities
int
ops
pow
real
rgb

RGB types, spaces and standards.

sign

Structs

Hsl

Linear HSL color space.

Hsv

Linear HSV color space.

ParseFloatError
WindowId

Identifier of a window. Unique for each window.

Enums

FloatErrorKind
Key

Symbolic name for a keyboard key.

MouseButton

Describes a button of a mouse controller.

MouseScrollDelta

Describes a difference in the mouse scroll wheel state.

TouchPhase

Describes touch-screen input state.

Constants

ALICEBLUE

ANTIQUEWHITE

AQUA

AQUAMARINE

AZURE

BEIGE

BISQUE

BLACK

BLANCHEDALMOND

BLUE

BLUEVIOLET

BROWN

BURLYWOOD

CADETBLUE

CHARTREUSE

CHOCOLATE

CORAL

CORNFLOWERBLUE

CORNSILK

CRIMSON

CYAN

DARKBLUE

DARKCYAN

DARKGOLDENROD

DARKGRAY

DARKGREEN

DARKGREY

DARKKHAKI

DARKMAGENTA

DARKOLIVEGREEN

DARKORANGE

DARKORCHID

DARKRED

DARKSALMON

DARKSEAGREEN

DARKSLATEBLUE

DARKSLATEGRAY

DARKSLATEGREY

DARKTURQUOISE

DARKVIOLET

DEEPPINK

DEEPSKYBLUE

DIMGRAY

DIMGREY

DODGERBLUE

FIREBRICK

FLORALWHITE

FORESTGREEN

FUCHSIA

GAINSBORO

GHOSTWHITE

GOLD

GOLDENROD

GRAY

GREEN

GREENYELLOW

GREY

HONEYDEW

HOTPINK

INDIANRED

INDIGO

IVORY

KHAKI

LAVENDER

LAVENDERBLUSH

LAWNGREEN

LEMONCHIFFON

LIGHTBLUE

LIGHTCORAL

LIGHTCYAN

LIGHTGOLDENRODYELLOW

LIGHTGRAY

LIGHTGREEN

LIGHTGREY

LIGHTPINK

LIGHTSALMON

LIGHTSEAGREEN

LIGHTSKYBLUE

LIGHTSLATEGRAY

LIGHTSLATEGREY

LIGHTSTEELBLUE

LIGHTYELLOW

LIME

LIMEGREEN

LINEN

MAGENTA

MAROON

MEDIUMAQUAMARINE

MEDIUMBLUE

MEDIUMORCHID

MEDIUMPURPLE

MEDIUMSEAGREEN

MEDIUMSLATEBLUE

MEDIUMSPRINGGREEN

MEDIUMTURQUOISE

MEDIUMVIOLETRED

MIDNIGHTBLUE

MINTCREAM

MISTYROSE

MOCCASIN

NAVAJOWHITE

NAVY

OLDLACE

OLIVE

OLIVEDRAB

ORANGE

ORANGERED

ORCHID

PALEGOLDENROD

PALEGREEN

PALETURQUOISE

PALEVIOLETRED

PAPAYAWHIP

PEACHPUFF

PERU

PI

Archimedes' constant (π)

PINK

PI_F64

Archimedes' constant (π)

PLUM

POWDERBLUE

PURPLE

REBECCAPURPLE

RED

ROSYBROWN

ROYALBLUE

SADDLEBROWN

SALMON

SANDYBROWN

SEAGREEN

SEASHELL

SIENNA

SILVER

SKYBLUE

SLATEBLUE

SLATEGRAY

SLATEGREY

SNOW

SPRINGGREEN

STEELBLUE

TAN

TAU

Two times PI.

TAU_F64

Two times PI.

TEAL

THISTLE

TOMATO

TURQUOISE

VIOLET

WHEAT

WHITE

WHITESMOKE

YELLOW

YELLOWGREEN

Traits

Angle

Angles and their associated trigonometric functions.

Array

An array containing elements of type Element

Bounded

Numbers which have upper and lower bounds

ElementWise

Element-wise arithmetic operations. These are supplied for pragmatic reasons, but will usually fall outside of traditional algebraic properties.

EuclideanSpace

Points in a Euclidean space with an associated space of displacement vectors.

GpuFuture

Represents an event that will happen on the GPU in the future.

InnerSpace

Vectors that also have a dot (or inner) product.

Matrix

A column-major matrix of arbitrary dimensions.

MetricSpace

A type with a distance function between values.

Num

The base trait for numeric types, covering 0 and 1 values, comparisons, basic numeric operations, and string conversion.

NumAssign

The trait for Num types which also implement assignment operators.

NumAssignOps

The trait for types implementing numeric assignment operators (like +=).

NumAssignRef

The trait for NumAssign types which also implement assignment operations taking the second operand by reference.

NumOps

The trait for types implementing basic numeric operations

NumRef

The trait for Num types which also implement numeric operations taking the second operand by reference.

One

Defines a multiplicative identity element for Self.

RefNum

The trait for references which implement numeric operations, taking the second operand either by value or by reference.

Rotation

A trait for a generic rotation. A rotation is a transformation that creates a circular motion, and preserves at least one point in the space.

Rotation2

A two-dimensional rotation.

Rotation3

A three-dimensional rotation.

SquareMatrix

A column-major major matrix where the rows and column vectors are of the same dimensions.

Transform

A trait representing an affine transformation that can be applied to points or vectors. An affine transformation is one which

Transform2
Transform3
VectorSpace

Vectors that can be added together and multiplied by scalars.

VulkanDeviceOwned

Implemented on objects that belong to a Vulkan device.

Zero

Defines an additive identity element for Self.

Functions

clamp

A value bounded by a minimum and a maximum

from_str

Get a SVG/CSS3 color by name. Can be toggled with the "named_from_str" Cargo feature.

random

Generates a random value using the thread-local random number generator.

Type Definitions

Hsla

Linear HSL with an alpha component. See the Hsla implementation in Alpha.

Hsva

Linear HSV with an alpha component. See the Hsva implementation in Alpha.

LinSrgb

Linear sRGB.

LinSrgba

Linear sRGB with an alpha component.

Srgb

Nonlinear sRGB.

Srgba

Nonlinear sRGB with an alpha component.