mcu

package
v1.17.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcu is a port of Google's material-color-utilities (the Dart package in reference/material-color-utilities): the HCT color space, the CAM16 color appearance model, tonal palettes, the dynamic color scheme variants and the contrast tools that Material 3 builds its color schemes with. Colors are ARGB values in a uint32, as 0xAARRGGBB.

The package ports hct, scheme, dynamiccolor, palettes, utils, contrast, blend, dislike and temperature. The image quantizers and the scoring of the colors of an image (quantize, score) are not ported: they are needed only by ColorScheme.fromImageProvider, which Glutter does not have (SPEC §12.10).

The code is a derivative of material-color-utilities (Apache-2.0); see NOTICE.

Flutter: no counterpart

Index

Constants

View Source
const CommonSize = len(CommonTones)

CommonSize is the number of the common tones.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.commonSize

View Source
const ContentAccentToneDelta = 15.0

ContentAccentToneDelta is the tone difference of the accents of a content scheme.

Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.contentAccentToneDelta

View Source
const CorePaletteSize = 5

CorePaletteSize is the number of the palettes that a list of colors holds.

Flutter: material-color-utilities palettes/core_palette.dart CorePalette.size

Variables

View Source
var CommonTones = [...]int{0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 99, 100}

CommonTones are the tones that a palette lists: the ones of the Material 3 tonal palettes.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.commonTones

View Source
var ViewingConditionsSRGB = NewViewingConditions(ViewingConditionsOpts{})

ViewingConditionsSRGB are the conditions of sRGB: D65, an adapting luminance of 11.72 cd/m2 and a 50% gray background. It is read-only.

Flutter: material-color-utilities hct/viewing_conditions.dart ViewingConditions.sRgb

View Source
var ViewingConditionsStandard = ViewingConditionsSRGB

ViewingConditionsStandard is ViewingConditionsSRGB.

Flutter: material-color-utilities hct/viewing_conditions.dart ViewingConditions.standard

Functions

func AlphaFromArgb

func AlphaFromArgb(argb uint32) int

AlphaFromArgb is the alpha component of a color in ARGB format.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.alphaFromArgb

func ArgbFromHex

func ArgbFromHex(hex string) (argb uint32, ok bool)

ArgbFromHex parses a hex string, with or without the hash sign; ok is false when it is not hexadecimal.

Flutter: material-color-utilities utils/string_utils.dart StringUtils.argbFromHex

func ArgbFromLab

func ArgbFromLab(l, a, b float64) uint32

ArgbFromLab converts a color represented in Lab color space into an ARGB value.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.argbFromLab

func ArgbFromLinrgb

func ArgbFromLinrgb(linrgb [3]float64) uint32

ArgbFromLinrgb converts a color from linear RGB components to ARGB format.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.argbFromLinrgb

func ArgbFromLstar

func ArgbFromLstar(lstar float64) uint32

ArgbFromLstar converts an L* value to the ARGB representation of the grayscale color with that lightness.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.argbFromLstar

func ArgbFromRgb

func ArgbFromRgb(red, green, blue int) uint32

ArgbFromRgb converts a color from RGB components to ARGB format.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.argbFromRgb

func ArgbFromXyz

func ArgbFromXyz(x, y, z float64) uint32

ArgbFromXyz converts a color from XYZ to ARGB.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.argbFromXyz

func BlendCam16Ucs

func BlendCam16Ucs(from, to uint32, amount float64) uint32

BlendCam16Ucs blends two colors in CAM16-UCS.

Flutter: material-color-utilities blend/blend.dart Blend.cam16Ucs

func BlendHctHue

func BlendHctHue(from, to uint32, amount float64) uint32

BlendHctHue blends the hue of a color towards another, in CAM16-UCS, keeping the chroma and the tone of the first one. The amount is from 0 (the first color) to 1 (the hue of the second).

Flutter: material-color-utilities blend/blend.dart Blend.hctHue

func BlueFromArgb

func BlueFromArgb(argb uint32) int

BlueFromArgb is the blue component of a color in ARGB format.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.blueFromArgb

func ClampDouble

func ClampDouble(lo, hi, input float64) float64

ClampDouble clamps a number between two numbers.

Flutter: material-color-utilities utils/math_utils.dart MathUtils.clampDouble

func ClampInt

func ClampInt(lo, hi, input int) int

ClampInt clamps an integer between two integers.

Flutter: material-color-utilities utils/math_utils.dart MathUtils.clampInt

func Darker

func Darker(tone, ratio float64) float64

Darker is the tone that is darker than the tone and has the contrast ratio with it, or -1 when there is none.

Flutter: material-color-utilities contrast/contrast.dart Contrast.darker

func DarkerUnsafe

func DarkerUnsafe(tone, ratio float64) float64

DarkerUnsafe is like Darker, but 0 when there is no such tone. The ratio is then not reached.

Flutter: material-color-utilities contrast/contrast.dart Contrast.darkerUnsafe

func Delinearized

func Delinearized(rgbComponent float64) int

Delinearized delinearizes an RGB component: 0.0 <= rgbComponent <= 100.0 becomes 0 <= output <= 255.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.delinearized

func DifferenceDegrees

func DifferenceDegrees(a, b float64) float64

DifferenceDegrees is the distance of two points on a circle, in degrees.

Flutter: material-color-utilities utils/math_utils.dart MathUtils.differenceDegrees

func EnableLightForeground

func EnableLightForeground(tone float64) float64

EnableLightForeground is the tone, or 49 when the tone prefers a light foreground that it does not allow: with a tone from 50 to 59 a light foreground does not have the contrast.

Flutter: material-color-utilities dynamiccolor/dynamic_color.dart DynamicColor.enableLightForeground

func ForegroundTone

func ForegroundTone(bgTone, ratio float64) float64

ForegroundTone is the tone of a foreground on a background of the tone bgTone that has the contrast ratio with it: the lighter one when the background prefers a light foreground, unless the darker one has the better ratio.

Flutter: material-color-utilities dynamiccolor/dynamic_color.dart DynamicColor.foregroundTone

func GetRotatedHue

func GetRotatedHue(sourceColor *Hct, hues, rotations []float64) float64

GetRotatedHue is the hue of the source color rotated by the rotation of the range of hues that it is in: hues[i] < hue < hues[i+1] is rotated by rotations[i]. With one rotation it is the source hue plus it. In debug builds it panics with the tag DynamicSchemeRotations when the lists differ in length.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.getRotatedHue

func GreenFromArgb

func GreenFromArgb(argb uint32) int

GreenFromArgb is the green component of a color in ARGB format.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.greenFromArgb

func Harmonize

func Harmonize(designColor, sourceColor uint32) uint32

Harmonize shifts the hue of the design color towards the source color, by at most 15 degrees, keeping its chroma and tone: the custom colors of an app look like they belong to its theme.

Flutter: material-color-utilities blend/blend.dart Blend.harmonize

func HexFromArgb

func HexFromArgb(argb uint32, leadingHashSign bool) string

HexFromArgb is the hex string of a color, "#RRGGBB" with the hash sign, or "RRGGBB" without it.

Flutter: material-color-utilities utils/string_utils.dart StringUtils.hexFromArgb

func IsBetween

func IsBetween(angle, a, b float64) bool

IsBetween reports whether the angle is between a and b, going from a to b in the increasing direction.

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.isBetween

func IsDisliked

func IsDisliked(hct *Hct) bool

IsDisliked reports whether the color is a dark yellow-green that most people dislike: a hue from 90 to 111, a chroma above 16 and a tone below 65, each rounded.

Flutter: material-color-utilities dislike/dislike_analyzer.dart DislikeAnalyzer.isDisliked

func IsOpaque

func IsOpaque(argb uint32) bool

IsOpaque reports whether a color in ARGB format is opaque.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.isOpaque

func LabFromArgb

func LabFromArgb(argb uint32) [3]float64

LabFromArgb converts a color from ARGB representation to L*a*b*.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.labFromArgb

func Lerp

func Lerp(start, stop, amount float64) float64

Lerp is the linear interpolation function: start if amount = 0 and stop if amount = 1.

Flutter: material-color-utilities utils/math_utils.dart MathUtils.lerp

func Lighter

func Lighter(tone, ratio float64) float64

Lighter is the tone that is lighter than the tone and has the contrast ratio with it, or -1 when there is none (the ratio can't be reached, or the tone is not in 0..100). The result is 0.4 higher than the exact tone, so that mapping to the gamut keeps the ratio.

Flutter: material-color-utilities contrast/contrast.dart Contrast.lighter

func LighterUnsafe

func LighterUnsafe(tone, ratio float64) float64

LighterUnsafe is like Lighter, but 100 when there is no such tone. The ratio is then not reached.

Flutter: material-color-utilities contrast/contrast.dart Contrast.lighterUnsafe

func Linearized

func Linearized(rgbComponent int) float64

Linearized linearizes an RGB component: 0 <= rgbComponent <= 255 becomes 0.0 <= output <= 100.0.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.linearized

func LstarFromArgb

func LstarFromArgb(argb uint32) float64

LstarFromArgb computes the L* value of a color in ARGB representation.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.lstarFromArgb

func LstarFromY

func LstarFromY(y float64) float64

LstarFromY converts a Y value to an L* value.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.lstarFromY

func MatrixMultiply

func MatrixMultiply(row [3]float64, matrix [3][3]float64) [3]float64

MatrixMultiply multiplies a 1x3 row vector with a 3x3 matrix.

Flutter: material-color-utilities utils/math_utils.dart MathUtils.matrixMultiply

func RatioOfTones

func RatioOfTones(toneA, toneB float64) float64

RatioOfTones is the contrast ratio of two tones, from 1 to 21. The tones are clamped to 0..100.

Flutter: material-color-utilities contrast/contrast.dart Contrast.ratioOfTones

func RawTemperature

func RawTemperature(color *Hct) float64

RawTemperature is the temperature of a color, from a model of Ou, Woodcock and Wright: it follows the Lab hue and chroma, and is highest for the red-orange hues. Values are around -0.5 (cool) to 1 (warm).

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.rawTemperature

func RedFromArgb

func RedFromArgb(argb uint32) int

RedFromArgb is the red component of a color in ARGB format.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.redFromArgb

func RotationDirection

func RotationDirection(from, to float64) float64

RotationDirection is the sign of the direction change needed to travel from one angle to another: -1 if decreasing from leads to the shortest travel distance, 1 if increasing does. For angles 180 degrees apart, 1 is returned.

Flutter: material-color-utilities utils/math_utils.dart MathUtils.rotationDirection

func SanitizeDegreesDouble

func SanitizeDegreesDouble(degrees float64) float64

SanitizeDegreesDouble sanitizes a degree measure as a floating-point number: a degree measure between 0.0 (inclusive) and 360.0 (exclusive).

Flutter: material-color-utilities utils/math_utils.dart MathUtils.sanitizeDegreesDouble

func SanitizeDegreesInt

func SanitizeDegreesInt(degrees int) int

SanitizeDegreesInt sanitizes a degree measure as an integer: a degree measure between 0 (inclusive) and 360 (exclusive).

Flutter: material-color-utilities utils/math_utils.dart MathUtils.sanitizeDegreesInt

func Signum

func Signum(num float64) int

Signum is the signum function: 1 if num > 0, -1 if num < 0, and 0 if num = 0.

Flutter: material-color-utilities utils/math_utils.dart MathUtils.signum

func SolveHctToInt

func SolveHctToInt(hueDegrees, chroma, lstar float64) uint32

SolveHctToInt finds an sRGB color with the hue, chroma and tone: the exact color when the gamut has it, otherwise the color of the hue and tone with the highest chroma that fits.

Flutter: material-color-utilities hct/src/hct_solver.dart HctSolver.solveToInt

func ToneAllowsLightForeground

func ToneAllowsLightForeground(tone float64) bool

ToneAllowsLightForeground reports whether a light foreground has enough contrast over the tone: the rounded tone is at most 49.

Flutter: material-color-utilities dynamiccolor/dynamic_color.dart DynamicColor.toneAllowsLightForeground

func TonePrefersLightForeground

func TonePrefersLightForeground(tone float64) bool

TonePrefersLightForeground reports whether a light foreground is preferred over the tone: the rounded tone is below 60.

Flutter: material-color-utilities dynamiccolor/dynamic_color.dart DynamicColor.tonePrefersLightForeground

func WhitePointD65

func WhitePointD65() [3]float64

WhitePointD65 returns the standard white point; white on a sunny day.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.whitePointD65

func XyzFromArgb

func XyzFromArgb(argb uint32) [3]float64

XyzFromArgb converts a color from ARGB to XYZ.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.xyzFromArgb

func YFromLstar

func YFromLstar(lstar float64) float64

YFromLstar converts an L* value to a Y value: both measure luminance, L* perceptually and Y relatively.

Flutter: material-color-utilities utils/color_utils.dart ColorUtils.yFromLstar

Types

type Cam16

type Cam16 struct {
	// Hue is the hue, in degrees.
	Hue float64
	// Chroma is the chroma of the color.
	Chroma float64
	// J is the lightness.
	J float64
	// Q is the brightness.
	Q float64
	// M is the colorfulness.
	M float64
	// S is the saturation.
	S float64
	// Jstar is the lightness in CAM16-UCS.
	Jstar float64
	// Astar is the a* coordinate in CAM16-UCS.
	Astar float64
	// Bstar is the b* coordinate in CAM16-UCS.
	Bstar float64
}

Cam16 is a color in the CAM16 color appearance model: hue, chroma, lightness (J), brightness (Q), colorfulness (M), saturation (S), and the coordinates of the CAM16-UCS color space (Jstar, Astar, Bstar).

Flutter: material-color-utilities hct/cam16.dart Cam16

func Cam16FromInt

func Cam16FromInt(argb uint32) *Cam16

Cam16FromInt is the CAM16 color of an ARGB color, in the sRGB viewing conditions.

Flutter: material-color-utilities hct/cam16.dart Cam16.fromInt

func Cam16FromIntInViewingConditions

func Cam16FromIntInViewingConditions(argb uint32, vc *ViewingConditions) *Cam16

Cam16FromIntInViewingConditions is the CAM16 color of an ARGB color in the viewing conditions.

Flutter: material-color-utilities hct/cam16.dart Cam16.fromIntInViewingConditions

func Cam16FromJch

func Cam16FromJch(j, c, h float64) *Cam16

Cam16FromJch creates a CAM16 color from lightness, chroma and hue, in the sRGB viewing conditions.

Flutter: material-color-utilities hct/cam16.dart Cam16.fromJch

func Cam16FromJchInViewingConditions

func Cam16FromJchInViewingConditions(J, C, h float64, vc *ViewingConditions) *Cam16

Cam16FromJchInViewingConditions creates a CAM16 color from lightness, chroma and hue in the viewing conditions.

Flutter: material-color-utilities hct/cam16.dart Cam16.fromJchInViewingConditions

func Cam16FromUcs

func Cam16FromUcs(jstar, astar, bstar float64) *Cam16

Cam16FromUcs creates a CAM16 color from CAM16-UCS coordinates, in the standard viewing conditions.

Flutter: material-color-utilities hct/cam16.dart Cam16.fromUcs

func Cam16FromUcsInViewingConditions

func Cam16FromUcsInViewingConditions(jstar, astar, bstar float64, vc *ViewingConditions) *Cam16

Cam16FromUcsInViewingConditions creates a CAM16 color from CAM16-UCS coordinates in the viewing conditions.

Flutter: material-color-utilities hct/cam16.dart Cam16.fromUcsInViewingConditions

func Cam16FromXyzInViewingConditions

func Cam16FromXyzInViewingConditions(x, y, z float64, vc *ViewingConditions) *Cam16

Cam16FromXyzInViewingConditions is the CAM16 color of XYZ coordinates in the viewing conditions.

Flutter: material-color-utilities hct/cam16.dart Cam16.fromXyzInViewingConditions

func SolveHctToCam

func SolveHctToCam(hueDegrees, chroma, lstar float64) *Cam16

SolveHctToCam is the CAM16 color of SolveHctToInt.

Flutter: material-color-utilities hct/src/hct_solver.dart HctSolver.solveToCam

func (*Cam16) Distance

func (c *Cam16) Distance(other *Cam16) float64

Distance is the CAM16-UCS distance of two colors.

Flutter: material-color-utilities hct/cam16.dart Cam16.distance

func (*Cam16) ToInt

func (c *Cam16) ToInt() uint32

ToInt is the ARGB color of the CAM16 color in the sRGB viewing conditions.

Flutter: material-color-utilities hct/cam16.dart Cam16.toInt

func (*Cam16) Viewed

func (c *Cam16) Viewed(vc *ViewingConditions) uint32

Viewed is the ARGB color of the CAM16 color in the viewing conditions.

Flutter: material-color-utilities hct/cam16.dart Cam16.viewed

func (*Cam16) XyzInViewingConditions

func (c *Cam16) XyzInViewingConditions(vc *ViewingConditions) [3]float64

XyzInViewingConditions is the XYZ color of the CAM16 color in the viewing conditions.

Flutter: material-color-utilities hct/cam16.dart Cam16.xyzInViewingConditions

type ContrastCurve

type ContrastCurve struct {
	// Low is the value at contrast level -1.0.
	Low float64
	// Normal is the value at contrast level 0.0.
	Normal float64
	// Medium is the value at contrast level 0.5.
	Medium float64
	// High is the value at contrast level 1.0.
	High float64
}

ContrastCurve is a value that depends on the contrast level of a scheme: the contrast ratio that a color needs, at the lowest (-1), the standard (0), the medium (0.5) and the highest (1) contrast level.

Flutter: material-color-utilities dynamiccolor/src/contrast_curve.dart ContrastCurve

func NewContrastCurve

func NewContrastCurve(low, normal, medium, high float64) *ContrastCurve

NewContrastCurve creates a curve from its four values.

Flutter: material-color-utilities dynamiccolor/src/contrast_curve.dart ContrastCurve.new

func (*ContrastCurve) Get

func (c *ContrastCurve) Get(contrastLevel float64) float64

Get is the value at the contrast level, from -1.0 (the lowest contrast) to 1.0 (the highest): the values are interpolated between the levels.

Flutter: material-color-utilities dynamiccolor/src/contrast_curve.dart ContrastCurve.get

type CorePalette

type CorePalette struct {
	Primary, Secondary, Tertiary, Neutral, NeutralVariant, Error *TonalPalette
}

CorePalette is the palettes of the first version of the Material 3 color system: key colors that make the primary, secondary, tertiary, neutral, neutral variant and error palettes. DynamicScheme replaces it.

Flutter: material-color-utilities palettes/core_palette.dart CorePalette

func CorePaletteContentOf

func CorePaletteContentOf(argb uint32) *CorePalette

CorePaletteContentOf makes the palettes of a color that keep its chroma.

Flutter: material-color-utilities palettes/core_palette.dart CorePalette.contentOf

func CorePaletteFromList

func CorePaletteFromList(colors []uint32) *CorePalette

CorePaletteFromList makes the palettes from the colors of their common tones, the primary palette first. In debug builds it panics with the tag CorePaletteListSize when the list does not have the right size.

Flutter: material-color-utilities palettes/core_palette.dart CorePalette.fromList

func CorePaletteOf

func CorePaletteOf(argb uint32) *CorePalette

CorePaletteOf makes the palettes of a color.

Flutter: material-color-utilities palettes/core_palette.dart CorePalette.of

func (*CorePalette) AsList

func (c *CorePalette) AsList() []uint32

AsList is the colors of the common tones of the five palettes (not the error palette), the primary palette first.

Flutter: material-color-utilities palettes/core_palette.dart CorePalette.asList

func (*CorePalette) Equal

func (c *CorePalette) Equal(o *CorePalette) bool

Equal reports whether the palettes are the same.

Flutter: material-color-utilities palettes/core_palette.dart CorePalette.==

func (*CorePalette) String

func (c *CorePalette) String() string

String lists the palettes.

Flutter: material-color-utilities palettes/core_palette.dart CorePalette.toString

type CorePalettes

type CorePalettes struct {
	Primary, Secondary, Tertiary, Neutral, NeutralVariant *TonalPalette
}

CorePalettes is the five palettes that a dynamic scheme is made from.

Flutter: material-color-utilities palettes/core_palettes.dart CorePalettes

type DynamicColor

type DynamicColor struct {
	// Name is the name of the color, such as "primary_container".
	Name string
	// Palette is the palette of the scheme that the color is from.
	Palette func(*DynamicScheme) *TonalPalette
	// Tone is the tone of the color in the scheme, before it is adjusted for
	// contrast.
	Tone func(*DynamicScheme) float64
	// IsBackground says that the color is a background: it is kept out of the
	// awkward zone of the tones 50 to 59, where neither a light nor a dark
	// foreground has enough contrast.
	IsBackground bool
	// Background is the color that this color is drawn over, or nil.
	Background func(*DynamicScheme) *DynamicColor
	// SecondBackground is a second color that this color is drawn over, or nil.
	SecondBackground func(*DynamicScheme) *DynamicColor
	// ContrastCurve is the contrast ratio that the color needs against its
	// background; it is set when Background is.
	ContrastCurve *ContrastCurve
	// ToneDeltaPair is the constraint between this color and another, or nil.
	ToneDeltaPair func(*DynamicScheme) *ToneDeltaPair
}

DynamicColor is a color that adjusts itself to a DynamicScheme: it has a role in the scheme (a palette and a tone), and, when it is meant to be read on another color, it moves its tone until the contrast with that color is what the scheme's contrast level asks for.

Flutter: material-color-utilities dynamiccolor/dynamic_color.dart DynamicColor

var (
	// PrimaryPaletteKeyColor is the dynamic color primaryPaletteKeyColor of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.primaryPaletteKeyColor
	PrimaryPaletteKeyColor *DynamicColor
	// SecondaryPaletteKeyColor is the dynamic color secondaryPaletteKeyColor of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.secondaryPaletteKeyColor
	SecondaryPaletteKeyColor *DynamicColor
	// TertiaryPaletteKeyColor is the dynamic color tertiaryPaletteKeyColor of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.tertiaryPaletteKeyColor
	TertiaryPaletteKeyColor *DynamicColor
	// NeutralPaletteKeyColor is the dynamic color neutralPaletteKeyColor of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.neutralPaletteKeyColor
	NeutralPaletteKeyColor *DynamicColor
	// NeutralVariantPaletteKeyColor is the dynamic color neutralVariantPaletteKeyColor of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.neutralVariantPaletteKeyColor
	NeutralVariantPaletteKeyColor *DynamicColor
	// Background is the dynamic color background of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.background
	Background *DynamicColor
	// OnBackground is the dynamic color onBackground of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onBackground
	OnBackground *DynamicColor
	// Surface is the dynamic color surface of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.surface
	Surface *DynamicColor
	// SurfaceDim is the dynamic color surfaceDim of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.surfaceDim
	SurfaceDim *DynamicColor
	// SurfaceBright is the dynamic color surfaceBright of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.surfaceBright
	SurfaceBright *DynamicColor
	// SurfaceContainerLowest is the dynamic color surfaceContainerLowest of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.surfaceContainerLowest
	SurfaceContainerLowest *DynamicColor
	// SurfaceContainerLow is the dynamic color surfaceContainerLow of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.surfaceContainerLow
	SurfaceContainerLow *DynamicColor
	// SurfaceContainer is the dynamic color surfaceContainer of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.surfaceContainer
	SurfaceContainer *DynamicColor
	// SurfaceContainerHigh is the dynamic color surfaceContainerHigh of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.surfaceContainerHigh
	SurfaceContainerHigh *DynamicColor
	// SurfaceContainerHighest is the dynamic color surfaceContainerHighest of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.surfaceContainerHighest
	SurfaceContainerHighest *DynamicColor
	// OnSurface is the dynamic color onSurface of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onSurface
	OnSurface *DynamicColor
	// SurfaceVariant is the dynamic color surfaceVariant of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.surfaceVariant
	SurfaceVariant *DynamicColor
	// OnSurfaceVariant is the dynamic color onSurfaceVariant of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onSurfaceVariant
	OnSurfaceVariant *DynamicColor
	// InverseSurface is the dynamic color inverseSurface of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.inverseSurface
	InverseSurface *DynamicColor
	// InverseOnSurface is the dynamic color inverseOnSurface of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.inverseOnSurface
	InverseOnSurface *DynamicColor
	// Outline is the dynamic color outline of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.outline
	Outline *DynamicColor
	// OutlineVariant is the dynamic color outlineVariant of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.outlineVariant
	OutlineVariant *DynamicColor
	// Shadow is the dynamic color shadow of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.shadow
	Shadow *DynamicColor
	// Scrim is the dynamic color scrim of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.scrim
	Scrim *DynamicColor
	// SurfaceTint is the dynamic color surfaceTint of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.surfaceTint
	SurfaceTint *DynamicColor
	// Primary is the dynamic color primary of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.primary
	Primary *DynamicColor
	// OnPrimary is the dynamic color onPrimary of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onPrimary
	OnPrimary *DynamicColor
	// PrimaryContainer is the dynamic color primaryContainer of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.primaryContainer
	PrimaryContainer *DynamicColor
	// OnPrimaryContainer is the dynamic color onPrimaryContainer of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onPrimaryContainer
	OnPrimaryContainer *DynamicColor
	// InversePrimary is the dynamic color inversePrimary of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.inversePrimary
	InversePrimary *DynamicColor
	// Secondary is the dynamic color secondary of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.secondary
	Secondary *DynamicColor
	// OnSecondary is the dynamic color onSecondary of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onSecondary
	OnSecondary *DynamicColor
	// SecondaryContainer is the dynamic color secondaryContainer of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.secondaryContainer
	SecondaryContainer *DynamicColor
	// OnSecondaryContainer is the dynamic color onSecondaryContainer of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onSecondaryContainer
	OnSecondaryContainer *DynamicColor
	// Tertiary is the dynamic color tertiary of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.tertiary
	Tertiary *DynamicColor
	// OnTertiary is the dynamic color onTertiary of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onTertiary
	OnTertiary *DynamicColor
	// TertiaryContainer is the dynamic color tertiaryContainer of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.tertiaryContainer
	TertiaryContainer *DynamicColor
	// OnTertiaryContainer is the dynamic color onTertiaryContainer of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onTertiaryContainer
	OnTertiaryContainer *DynamicColor
	// Error is the dynamic color error of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.error
	Error *DynamicColor
	// OnError is the dynamic color onError of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onError
	OnError *DynamicColor
	// ErrorContainer is the dynamic color errorContainer of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.errorContainer
	ErrorContainer *DynamicColor
	// OnErrorContainer is the dynamic color onErrorContainer of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onErrorContainer
	OnErrorContainer *DynamicColor
	// PrimaryFixed is the dynamic color primaryFixed of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.primaryFixed
	PrimaryFixed *DynamicColor
	// PrimaryFixedDim is the dynamic color primaryFixedDim of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.primaryFixedDim
	PrimaryFixedDim *DynamicColor
	// OnPrimaryFixed is the dynamic color onPrimaryFixed of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onPrimaryFixed
	OnPrimaryFixed *DynamicColor
	// OnPrimaryFixedVariant is the dynamic color onPrimaryFixedVariant of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onPrimaryFixedVariant
	OnPrimaryFixedVariant *DynamicColor
	// SecondaryFixed is the dynamic color secondaryFixed of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.secondaryFixed
	SecondaryFixed *DynamicColor
	// SecondaryFixedDim is the dynamic color secondaryFixedDim of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.secondaryFixedDim
	SecondaryFixedDim *DynamicColor
	// OnSecondaryFixed is the dynamic color onSecondaryFixed of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onSecondaryFixed
	OnSecondaryFixed *DynamicColor
	// OnSecondaryFixedVariant is the dynamic color onSecondaryFixedVariant of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onSecondaryFixedVariant
	OnSecondaryFixedVariant *DynamicColor
	// TertiaryFixed is the dynamic color tertiaryFixed of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.tertiaryFixed
	TertiaryFixed *DynamicColor
	// TertiaryFixedDim is the dynamic color tertiaryFixedDim of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.tertiaryFixedDim
	TertiaryFixedDim *DynamicColor
	// OnTertiaryFixed is the dynamic color onTertiaryFixed of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onTertiaryFixed
	OnTertiaryFixed *DynamicColor
	// OnTertiaryFixedVariant is the dynamic color onTertiaryFixedVariant of Material 3.
	//
	// Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.onTertiaryFixedVariant
	OnTertiaryFixedVariant *DynamicColor
)

The dynamic colors of Material 3: the colors that a color scheme has, with the tone and the contrast that each one has in a scheme. They are read-only, and are made when the package is initialized, because they refer to each other.

func HighestSurface

func HighestSurface(s *DynamicScheme) *DynamicColor

HighestSurface is the surface that is the farthest from the background in the scheme: the brightest surface of a dark scheme and the dimmest of a light one.

Flutter: material-color-utilities dynamiccolor/material_dynamic_colors.dart MaterialDynamicColors.highestSurface

func NewDynamicColorFromPalette

func NewDynamicColorFromPalette(palette func(*DynamicScheme) *TonalPalette, tone func(*DynamicScheme) float64, o DynamicColorOpts) *DynamicColor

NewDynamicColorFromPalette creates a color from the palette and the tone of its role in a scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_color.dart DynamicColor.fromPalette

func (*DynamicColor) GetArgb

func (d *DynamicColor) GetArgb(scheme *DynamicScheme) uint32

GetArgb is the ARGB color in the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_color.dart DynamicColor.getArgb

func (*DynamicColor) GetHct

func (d *DynamicColor) GetHct(scheme *DynamicScheme) *Hct

GetHct is the color in the scheme. The scheme remembers the answer.

Flutter: material-color-utilities dynamiccolor/dynamic_color.dart DynamicColor.getHct

func (*DynamicColor) GetTone

func (d *DynamicColor) GetTone(scheme *DynamicScheme) float64

GetTone is the tone of the color in the scheme, adjusted for the contrast with its background (or backgrounds) at the contrast level of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_color.dart DynamicColor.getTone

type DynamicColorOpts

type DynamicColorOpts struct {
	// Name is the name of the color.
	Name string
	// IsBackground says that the color is a background.
	IsBackground bool
	// Background is the color that this color is drawn over.
	Background func(*DynamicScheme) *DynamicColor
	// SecondBackground is a second color that this color is drawn over.
	SecondBackground func(*DynamicScheme) *DynamicColor
	// ContrastCurve is the contrast ratio against the background.
	ContrastCurve *ContrastCurve
	// ToneDeltaPair is the constraint between this color and another.
	ToneDeltaPair func(*DynamicScheme) *ToneDeltaPair
}

DynamicColorOpts are the parameters of NewDynamicColorFromPalette.

Flutter: material-color-utilities dynamiccolor/dynamic_color.dart DynamicColor.fromPalette

type DynamicScheme

type DynamicScheme struct {
	// SourceColorArgb is the source color, as ARGB.
	SourceColorArgb uint32
	// SourceColorHct is the source color.
	SourceColorHct *Hct
	// Variant is the type of the scheme.
	Variant Variant
	// IsDark says that the scheme is a dark one.
	IsDark bool
	// ContrastLevel is from -1 (the lowest contrast) to 1 (the highest); 0 is the
	// standard.
	ContrastLevel float64
	// PrimaryPalette is the primary palette.
	PrimaryPalette *TonalPalette
	// SecondaryPalette is the secondary palette.
	SecondaryPalette *TonalPalette
	// TertiaryPalette is the tertiary palette.
	TertiaryPalette *TonalPalette
	// NeutralPalette is the neutral palette.
	NeutralPalette *TonalPalette
	// NeutralVariantPalette is the neutral variant palette.
	NeutralVariantPalette *TonalPalette
	// ErrorPalette is the error palette.
	ErrorPalette *TonalPalette
	// contains filtered or unexported fields
}

DynamicScheme is a color scheme: the six palettes that the colors of Material 3 are drawn from, whether it is dark, and its contrast level. The colors are the MaterialDynamicColors, read with their getters (Primary, Surface...) or with DynamicColor.GetArgb. A scheme remembers the colors it has made, so it is not safe for concurrent use.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme

func NewDynamicScheme

func NewDynamicScheme(o DynamicSchemeOpts) *DynamicScheme

NewDynamicScheme creates a scheme. In debug builds it panics with the tag DynamicSchemeIncomplete when the source color or a palette is missing.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.new

func NewSchemeContent

func NewSchemeContent(sourceColorHct *Hct, isDark bool, contrastLevel float64) *DynamicScheme

NewSchemeContent makes a scheme whose palettes and tokens match the source color, with the primary container the source color adjusted for contrast, and the tertiary palette an analogue of it (found by dividing the wheel by 6).

Flutter: material-color-utilities scheme/scheme_content.dart SchemeContent

func NewSchemeExpressive

func NewSchemeExpressive(sourceColorHct *Hct, isDark bool, contrastLevel float64) *DynamicScheme

NewSchemeExpressive makes a scheme of pastel colors and medium chroma palettes, whose primary hue is different from the source color, for variety.

Flutter: material-color-utilities scheme/scheme_expressive.dart SchemeExpressive

func NewSchemeFidelity

func NewSchemeFidelity(sourceColorHct *Hct, isDark bool, contrastLevel float64) *DynamicScheme

NewSchemeFidelity makes a scheme whose palettes and tokens match the source color, with the primary container the source color adjusted for contrast, and the tertiary palette its complement.

Flutter: material-color-utilities scheme/scheme_fidelity.dart SchemeFidelity

func NewSchemeFromVariant

func NewSchemeFromVariant(variant Variant, sourceColorHct *Hct, isDark bool, contrastLevel float64) *DynamicScheme

NewSchemeFromVariant makes the scheme of the variant, as the test helper schemeFromVariant of the Dart package does. VariantTonalSpot, and VariantUnspecified, make a tonal spot scheme.

Flutter: material-color-utilities test/utils/scheme_from_variant.dart schemeFromVariant

func NewSchemeFruitSalad

func NewSchemeFruitSalad(sourceColorHct *Hct, isDark bool, contrastLevel float64) *DynamicScheme

NewSchemeFruitSalad makes a playful scheme in which the hue of the source color does not appear.

Flutter: material-color-utilities scheme/scheme_fruit_salad.dart SchemeFruitSalad

func NewSchemeMonochrome

func NewSchemeMonochrome(sourceColorHct *Hct, isDark bool, contrastLevel float64) *DynamicScheme

NewSchemeMonochrome makes a scheme in which all colors are grayscale.

Flutter: material-color-utilities scheme/scheme_monochrome.dart SchemeMonochrome

func NewSchemeNeutral

func NewSchemeNeutral(sourceColorHct *Hct, isDark bool, contrastLevel float64) *DynamicScheme

NewSchemeNeutral makes a scheme that is close to grayscale, with a hint of chroma.

Flutter: material-color-utilities scheme/scheme_neutral.dart SchemeNeutral

func NewSchemeRainbow

func NewSchemeRainbow(sourceColorHct *Hct, isDark bool, contrastLevel float64) *DynamicScheme

NewSchemeRainbow makes a playful scheme in which the hue of the source color does not appear in the secondary and the neutral palettes.

Flutter: material-color-utilities scheme/scheme_rainbow.dart SchemeRainbow

func NewSchemeTonalSpot

func NewSchemeTonalSpot(sourceColorHct *Hct, isDark bool, contrastLevel float64) *DynamicScheme

NewSchemeTonalSpot makes the default Material You scheme of 2021: pastel tokens and low chroma palettes.

Flutter: material-color-utilities scheme/scheme_tonal_spot.dart SchemeTonalSpot

func NewSchemeVibrant

func NewSchemeVibrant(sourceColorHct *Hct, isDark bool, contrastLevel float64) *DynamicScheme

NewSchemeVibrant makes a scheme of pastel colors and high chroma palettes: the chroma of the primary palette is at its maximum.

Flutter: material-color-utilities scheme/scheme_vibrant.dart SchemeVibrant

func (*DynamicScheme) Background

func (s *DynamicScheme) Background() uint32

Background is the ARGB color background of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.background

func (*DynamicScheme) Error

func (s *DynamicScheme) Error() uint32

Error is the ARGB color error of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.error

func (*DynamicScheme) ErrorContainer

func (s *DynamicScheme) ErrorContainer() uint32

ErrorContainer is the ARGB color errorContainer of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.errorContainer

func (*DynamicScheme) GetArgb

func (s *DynamicScheme) GetArgb(c *DynamicColor) uint32

GetArgb is the ARGB color of the dynamic color in the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.getArgb

func (*DynamicScheme) GetHct

func (s *DynamicScheme) GetHct(c *DynamicColor) *Hct

GetHct is the color of the dynamic color in the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.getHct

func (*DynamicScheme) InverseOnSurface

func (s *DynamicScheme) InverseOnSurface() uint32

InverseOnSurface is the ARGB color inverseOnSurface of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.inverseOnSurface

func (*DynamicScheme) InversePrimary

func (s *DynamicScheme) InversePrimary() uint32

InversePrimary is the ARGB color inversePrimary of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.inversePrimary

func (*DynamicScheme) InverseSurface

func (s *DynamicScheme) InverseSurface() uint32

InverseSurface is the ARGB color inverseSurface of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.inverseSurface

func (*DynamicScheme) NeutralPaletteKeyColor

func (s *DynamicScheme) NeutralPaletteKeyColor() uint32

NeutralPaletteKeyColor is the ARGB color neutralPaletteKeyColor of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.neutralPaletteKeyColor

func (*DynamicScheme) NeutralVariantPaletteKeyColor

func (s *DynamicScheme) NeutralVariantPaletteKeyColor() uint32

NeutralVariantPaletteKeyColor is the ARGB color neutralVariantPaletteKeyColor of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.neutralVariantPaletteKeyColor

func (*DynamicScheme) OnBackground

func (s *DynamicScheme) OnBackground() uint32

OnBackground is the ARGB color onBackground of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onBackground

func (*DynamicScheme) OnError

func (s *DynamicScheme) OnError() uint32

OnError is the ARGB color onError of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onError

func (*DynamicScheme) OnErrorContainer

func (s *DynamicScheme) OnErrorContainer() uint32

OnErrorContainer is the ARGB color onErrorContainer of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onErrorContainer

func (*DynamicScheme) OnPrimary

func (s *DynamicScheme) OnPrimary() uint32

OnPrimary is the ARGB color onPrimary of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onPrimary

func (*DynamicScheme) OnPrimaryContainer

func (s *DynamicScheme) OnPrimaryContainer() uint32

OnPrimaryContainer is the ARGB color onPrimaryContainer of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onPrimaryContainer

func (*DynamicScheme) OnPrimaryFixed

func (s *DynamicScheme) OnPrimaryFixed() uint32

OnPrimaryFixed is the ARGB color onPrimaryFixed of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onPrimaryFixed

func (*DynamicScheme) OnPrimaryFixedVariant

func (s *DynamicScheme) OnPrimaryFixedVariant() uint32

OnPrimaryFixedVariant is the ARGB color onPrimaryFixedVariant of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onPrimaryFixedVariant

func (*DynamicScheme) OnSecondary

func (s *DynamicScheme) OnSecondary() uint32

OnSecondary is the ARGB color onSecondary of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onSecondary

func (*DynamicScheme) OnSecondaryContainer

func (s *DynamicScheme) OnSecondaryContainer() uint32

OnSecondaryContainer is the ARGB color onSecondaryContainer of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onSecondaryContainer

func (*DynamicScheme) OnSecondaryFixed

func (s *DynamicScheme) OnSecondaryFixed() uint32

OnSecondaryFixed is the ARGB color onSecondaryFixed of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onSecondaryFixed

func (*DynamicScheme) OnSecondaryFixedVariant

func (s *DynamicScheme) OnSecondaryFixedVariant() uint32

OnSecondaryFixedVariant is the ARGB color onSecondaryFixedVariant of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onSecondaryFixedVariant

func (*DynamicScheme) OnSurface

func (s *DynamicScheme) OnSurface() uint32

OnSurface is the ARGB color onSurface of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onSurface

func (*DynamicScheme) OnSurfaceVariant

func (s *DynamicScheme) OnSurfaceVariant() uint32

OnSurfaceVariant is the ARGB color onSurfaceVariant of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onSurfaceVariant

func (*DynamicScheme) OnTertiary

func (s *DynamicScheme) OnTertiary() uint32

OnTertiary is the ARGB color onTertiary of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onTertiary

func (*DynamicScheme) OnTertiaryContainer

func (s *DynamicScheme) OnTertiaryContainer() uint32

OnTertiaryContainer is the ARGB color onTertiaryContainer of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onTertiaryContainer

func (*DynamicScheme) OnTertiaryFixed

func (s *DynamicScheme) OnTertiaryFixed() uint32

OnTertiaryFixed is the ARGB color onTertiaryFixed of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onTertiaryFixed

func (*DynamicScheme) OnTertiaryFixedVariant

func (s *DynamicScheme) OnTertiaryFixedVariant() uint32

OnTertiaryFixedVariant is the ARGB color onTertiaryFixedVariant of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.onTertiaryFixedVariant

func (*DynamicScheme) Outline

func (s *DynamicScheme) Outline() uint32

Outline is the ARGB color outline of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.outline

func (*DynamicScheme) OutlineVariant

func (s *DynamicScheme) OutlineVariant() uint32

OutlineVariant is the ARGB color outlineVariant of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.outlineVariant

func (*DynamicScheme) Primary

func (s *DynamicScheme) Primary() uint32

Primary is the ARGB color primary of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.primary

func (*DynamicScheme) PrimaryContainer

func (s *DynamicScheme) PrimaryContainer() uint32

PrimaryContainer is the ARGB color primaryContainer of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.primaryContainer

func (*DynamicScheme) PrimaryFixed

func (s *DynamicScheme) PrimaryFixed() uint32

PrimaryFixed is the ARGB color primaryFixed of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.primaryFixed

func (*DynamicScheme) PrimaryFixedDim

func (s *DynamicScheme) PrimaryFixedDim() uint32

PrimaryFixedDim is the ARGB color primaryFixedDim of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.primaryFixedDim

func (*DynamicScheme) PrimaryPaletteKeyColor

func (s *DynamicScheme) PrimaryPaletteKeyColor() uint32

PrimaryPaletteKeyColor is the ARGB color primaryPaletteKeyColor of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.primaryPaletteKeyColor

func (*DynamicScheme) Scrim

func (s *DynamicScheme) Scrim() uint32

Scrim is the ARGB color scrim of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.scrim

func (*DynamicScheme) Secondary

func (s *DynamicScheme) Secondary() uint32

Secondary is the ARGB color secondary of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.secondary

func (*DynamicScheme) SecondaryContainer

func (s *DynamicScheme) SecondaryContainer() uint32

SecondaryContainer is the ARGB color secondaryContainer of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.secondaryContainer

func (*DynamicScheme) SecondaryFixed

func (s *DynamicScheme) SecondaryFixed() uint32

SecondaryFixed is the ARGB color secondaryFixed of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.secondaryFixed

func (*DynamicScheme) SecondaryFixedDim

func (s *DynamicScheme) SecondaryFixedDim() uint32

SecondaryFixedDim is the ARGB color secondaryFixedDim of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.secondaryFixedDim

func (*DynamicScheme) SecondaryPaletteKeyColor

func (s *DynamicScheme) SecondaryPaletteKeyColor() uint32

SecondaryPaletteKeyColor is the ARGB color secondaryPaletteKeyColor of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.secondaryPaletteKeyColor

func (*DynamicScheme) Shadow

func (s *DynamicScheme) Shadow() uint32

Shadow is the ARGB color shadow of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.shadow

func (*DynamicScheme) Surface

func (s *DynamicScheme) Surface() uint32

Surface is the ARGB color surface of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.surface

func (*DynamicScheme) SurfaceBright

func (s *DynamicScheme) SurfaceBright() uint32

SurfaceBright is the ARGB color surfaceBright of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.surfaceBright

func (*DynamicScheme) SurfaceContainer

func (s *DynamicScheme) SurfaceContainer() uint32

SurfaceContainer is the ARGB color surfaceContainer of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.surfaceContainer

func (*DynamicScheme) SurfaceContainerHigh

func (s *DynamicScheme) SurfaceContainerHigh() uint32

SurfaceContainerHigh is the ARGB color surfaceContainerHigh of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.surfaceContainerHigh

func (*DynamicScheme) SurfaceContainerHighest

func (s *DynamicScheme) SurfaceContainerHighest() uint32

SurfaceContainerHighest is the ARGB color surfaceContainerHighest of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.surfaceContainerHighest

func (*DynamicScheme) SurfaceContainerLow

func (s *DynamicScheme) SurfaceContainerLow() uint32

SurfaceContainerLow is the ARGB color surfaceContainerLow of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.surfaceContainerLow

func (*DynamicScheme) SurfaceContainerLowest

func (s *DynamicScheme) SurfaceContainerLowest() uint32

SurfaceContainerLowest is the ARGB color surfaceContainerLowest of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.surfaceContainerLowest

func (*DynamicScheme) SurfaceDim

func (s *DynamicScheme) SurfaceDim() uint32

SurfaceDim is the ARGB color surfaceDim of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.surfaceDim

func (*DynamicScheme) SurfaceTint

func (s *DynamicScheme) SurfaceTint() uint32

SurfaceTint is the ARGB color surfaceTint of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.surfaceTint

func (*DynamicScheme) SurfaceVariant

func (s *DynamicScheme) SurfaceVariant() uint32

SurfaceVariant is the ARGB color surfaceVariant of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.surfaceVariant

func (*DynamicScheme) Tertiary

func (s *DynamicScheme) Tertiary() uint32

Tertiary is the ARGB color tertiary of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.tertiary

func (*DynamicScheme) TertiaryContainer

func (s *DynamicScheme) TertiaryContainer() uint32

TertiaryContainer is the ARGB color tertiaryContainer of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.tertiaryContainer

func (*DynamicScheme) TertiaryFixed

func (s *DynamicScheme) TertiaryFixed() uint32

TertiaryFixed is the ARGB color tertiaryFixed of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.tertiaryFixed

func (*DynamicScheme) TertiaryFixedDim

func (s *DynamicScheme) TertiaryFixedDim() uint32

TertiaryFixedDim is the ARGB color tertiaryFixedDim of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.tertiaryFixedDim

func (*DynamicScheme) TertiaryPaletteKeyColor

func (s *DynamicScheme) TertiaryPaletteKeyColor() uint32

TertiaryPaletteKeyColor is the ARGB color tertiaryPaletteKeyColor of the scheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.tertiaryPaletteKeyColor

type DynamicSchemeOpts

type DynamicSchemeOpts struct {
	// SourceColorHct is the source color. It is required.
	SourceColorHct *Hct
	// Variant is the type of the scheme.
	Variant Variant
	// ContrastLevel is from -1 to 1; the default is 0.
	ContrastLevel float64
	// IsDark says that the scheme is a dark one.
	IsDark bool
	// PrimaryPalette, SecondaryPalette, TertiaryPalette, NeutralPalette and
	// NeutralVariantPalette are required.
	PrimaryPalette, SecondaryPalette, TertiaryPalette, NeutralPalette, NeutralVariantPalette *TonalPalette
	// ErrorPalette is the error palette; the default is TonalPalette.of(25, 84).
	ErrorPalette *TonalPalette
}

DynamicSchemeOpts are the parameters of NewDynamicScheme.

Flutter: material-color-utilities dynamiccolor/dynamic_scheme.dart DynamicScheme.new

type Hct

type Hct struct {
	// contains filtered or unexported fields
}

Hct is a color in the HCT color space: hue and chroma of CAM16, and the tone (L*) of the Lab color space. HCT is what Material 3 builds its palettes with: the tone is perceptually even, and a color of a given hue and chroma exists at every tone that the sRGB gamut allows.

Flutter: material-color-utilities hct/hct.dart Hct

func FixIfDisliked

func FixIfDisliked(hct *Hct) *Hct

FixIfDisliked is the color, or the same color at tone 70 when the color is disliked.

Flutter: material-color-utilities dislike/dislike_analyzer.dart DislikeAnalyzer.fixIfDisliked

func HctFrom

func HctFrom(hue, chroma, tone float64) *Hct

HctFrom creates a color from the hue, chroma and tone. The color is the closest one in the sRGB gamut, so its chroma can be lower than asked.

Flutter: material-color-utilities hct/hct.dart Hct.from

func HctFromInt

func HctFromInt(argb uint32) *Hct

HctFromInt creates a color from an ARGB value.

Flutter: material-color-utilities hct/hct.dart Hct.fromInt

func (*Hct) Chroma

func (h *Hct) Chroma() float64

Chroma is the chroma.

Flutter: material-color-utilities hct/hct.dart Hct.chroma

func (*Hct) Equal

func (h *Hct) Equal(other *Hct) bool

Equal reports whether two colors are the same ARGB value.

Flutter: material-color-utilities hct/hct.dart Hct.==

func (*Hct) Hue

func (h *Hct) Hue() float64

Hue is the hue, from 0 (inclusive) to 360 (exclusive).

Flutter: material-color-utilities hct/hct.dart Hct.hue

func (*Hct) InViewingConditions

func (h *Hct) InViewingConditions(vc *ViewingConditions) *Hct

InViewingConditions translates the color into the color that looks the same in the viewing conditions: the HCT of the color when it is viewed there.

Flutter: material-color-utilities hct/hct.dart Hct.inViewingConditions

func (*Hct) SetChroma

func (h *Hct) SetChroma(newChroma float64)

SetChroma changes the chroma, keeping the hue and the tone as far as the gamut allows.

Flutter: material-color-utilities hct/hct.dart Hct.chroma

func (*Hct) SetHue

func (h *Hct) SetHue(newHue float64)

SetHue changes the hue, keeping the chroma and the tone as far as the gamut allows.

Flutter: material-color-utilities hct/hct.dart Hct.hue

func (*Hct) SetTone

func (h *Hct) SetTone(newTone float64)

SetTone changes the tone, keeping the hue and the chroma as far as the gamut allows.

Flutter: material-color-utilities hct/hct.dart Hct.tone

func (*Hct) String

func (h *Hct) String() string

String is the color as "H<hue> C<chroma> T<tone>", each rounded.

Flutter: material-color-utilities hct/hct.dart Hct.toString

func (*Hct) ToInt

func (h *Hct) ToInt() uint32

ToInt is the ARGB value of the color.

Flutter: material-color-utilities hct/hct.dart Hct.toInt

func (*Hct) Tone

func (h *Hct) Tone() float64

Tone is the tone, from 0 (black) to 100 (white).

Flutter: material-color-utilities hct/hct.dart Hct.tone

type KeyColor

type KeyColor struct {
	// contains filtered or unexported fields
}

KeyColor finds the key color of a hue and a chroma: the color of that hue that has the requested chroma at the tone nearest to 50, or the most chromatic one when the hue can't reach it.

Flutter: material-color-utilities palettes/tonal_palette.dart KeyColor

func NewKeyColor

func NewKeyColor(hue, requestedChroma float64) *KeyColor

NewKeyColor creates a key color finder.

Flutter: material-color-utilities palettes/tonal_palette.dart KeyColor.new

func (*KeyColor) Create

func (k *KeyColor) Create() *Hct

Create finds the key color.

Flutter: material-color-utilities palettes/tonal_palette.dart KeyColor.create

type Scheme

type Scheme struct {
	Primary, OnPrimary, PrimaryContainer, OnPrimaryContainer         uint32
	Secondary, OnSecondary, SecondaryContainer, OnSecondaryContainer uint32
	Tertiary, OnTertiary, TertiaryContainer, OnTertiaryContainer     uint32
	Error, OnError, ErrorContainer, OnErrorContainer                 uint32
	Background, OnBackground, Surface, OnSurface                     uint32
	SurfaceVariant, OnSurfaceVariant, Outline, OutlineVariant        uint32
	Shadow, Scrim, InverseSurface, InverseOnSurface, InversePrimary  uint32
}

Scheme is the first version of the Material 3 color scheme: the colors of the light or the dark scheme of a core palette. DynamicScheme replaces it.

Flutter: material-color-utilities scheme/scheme.dart Scheme

func SchemeDark

func SchemeDark(color uint32) *Scheme

SchemeDark is the dark scheme of a color.

Flutter: material-color-utilities scheme/scheme.dart Scheme.dark

func SchemeDarkContent

func SchemeDarkContent(color uint32) *Scheme

SchemeDarkContent is the dark scheme of a color that keeps its chroma.

Flutter: material-color-utilities scheme/scheme.dart Scheme.darkContent

func SchemeDarkFromCorePalette

func SchemeDarkFromCorePalette(p *CorePalette) *Scheme

SchemeDarkFromCorePalette is the dark scheme of the palettes. (The color onErrorContainer is the tone 80 of the error palette, as in the Dart source, where the light scheme has 10 and the others 90.)

Flutter: material-color-utilities scheme/scheme.dart Scheme.darkFromCorePalette

func SchemeLight

func SchemeLight(color uint32) *Scheme

SchemeLight is the light scheme of a color.

Flutter: material-color-utilities scheme/scheme.dart Scheme.light

func SchemeLightContent

func SchemeLightContent(color uint32) *Scheme

SchemeLightContent is the light scheme of a color that keeps its chroma.

Flutter: material-color-utilities scheme/scheme.dart Scheme.lightContent

func SchemeLightFromCorePalette

func SchemeLightFromCorePalette(p *CorePalette) *Scheme

SchemeLightFromCorePalette is the light scheme of the palettes.

Flutter: material-color-utilities scheme/scheme.dart Scheme.lightFromCorePalette

type TemperatureCache

type TemperatureCache struct {
	// Input is the color the cache was made for.
	Input *Hct
	// contains filtered or unexported fields
}

TemperatureCache is a design system for color temperature: it ranks the colors of a color's chroma and tone around the hue wheel from cool to warm, and finds the complement and the analogous colors of the input by temperature. The results are cached; the type is not safe for concurrent use.

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache

func NewTemperatureCache

func NewTemperatureCache(input *Hct) *TemperatureCache

NewTemperatureCache creates the cache of a color.

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.new

func (*TemperatureCache) Analogous

func (c *TemperatureCache) Analogous(count, divisions int) []*Hct

Analogous is count colors that are the input and its neighbours on the hue wheel, found by dividing the wheel into divisions steps of equal temperature difference: the colors with a lower hue come first, the input is in the middle (when count is odd). The defaults of Flutter are 5 and 12.

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.analogous

func (*TemperatureCache) Coldest

func (c *TemperatureCache) Coldest() *Hct

Coldest is the coldest color of the input's chroma and tone, in any hue.

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.coldest

func (*TemperatureCache) Complement

func (c *TemperatureCache) Complement() *Hct

Complement is the color of the opposite temperature: its relative temperature is the inverse of the input's, on the other side of the wheel.

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.complement

func (*TemperatureCache) HctsByHue

func (c *TemperatureCache) HctsByHue() []*Hct

HctsByHue is the colors of the input's chroma and tone at the hues 0 to 360.

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.hctsByHue

func (*TemperatureCache) HctsByTemp

func (c *TemperatureCache) HctsByTemp() []*Hct

HctsByTemp is the colors of every whole hue and the input, from the coldest to the warmest.

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.hctsByTemp

func (*TemperatureCache) InputRelativeTemperature

func (c *TemperatureCache) InputRelativeTemperature() float64

InputRelativeTemperature is the relative temperature of the input.

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.inputRelativeTemperature

func (*TemperatureCache) RelativeTemperature

func (c *TemperatureCache) RelativeTemperature(hct *Hct) float64

RelativeTemperature is the temperature of the color relative to the coldest (0) and the warmest (1) of the cache. It is 0.5 when there is no difference, as at tone 100, where only white is available.

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.relativeTemperature

func (*TemperatureCache) TempsByHct

func (c *TemperatureCache) TempsByHct() map[uint32]float64

TempsByHct is the raw temperature of every color of HctsByHue and the input, by ARGB value (colors are equal when their ARGB values are).

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.tempsByHct

func (*TemperatureCache) Warmest

func (c *TemperatureCache) Warmest() *Hct

Warmest is the warmest color of the input's chroma and tone, in any hue.

Flutter: material-color-utilities temperature/temperature_cache.dart TemperatureCache.warmest

type TonalPalette

type TonalPalette struct {
	// contains filtered or unexported fields
}

TonalPalette is a convenience type for retrieving colors that are constant in hue and chroma, but vary in tone. A palette is not safe for concurrent use: it caches the colors it makes.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette

func TonalPaletteFromHct

func TonalPaletteFromHct(hct *Hct) *TonalPalette

TonalPaletteFromHct creates a palette from a color: the hue and the chroma of the color, and the color as the key color.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.fromHct

func TonalPaletteFromList

func TonalPaletteFromList(colors []uint32) *TonalPalette

TonalPaletteFromList creates a palette from the colors of the common tones. The hue and the chroma are deduced from the color of the highest chroma (the colors that are too close to white are ignored; see https://github.com/material-foundation/material-color-utilities/issues/140). In debug builds it panics with the tag TonalPaletteListSize when the list does not have CommonSize colors.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.fromList

func TonalPaletteOf

func TonalPaletteOf(hue, chroma float64) *TonalPalette

TonalPaletteOf creates a palette from a hue and a chroma, with the key color that the closest tone allows.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.of

func (*TonalPalette) AsList

func (p *TonalPalette) AsList() []uint32

AsList is the colors of the common tones.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.asList

func (*TonalPalette) Chroma

func (p *TonalPalette) Chroma() float64

Chroma is the chroma of the palette.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.chroma

func (*TonalPalette) Equal

func (p *TonalPalette) Equal(other *TonalPalette) bool

Equal reports whether two palettes are the same: two palettes made from a hue and a chroma (or a color) by the same hue and chroma, and any palettes with the same colors at the common tones.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.==

func (*TonalPalette) Get

func (p *TonalPalette) Get(tone int) uint32

Get is the ARGB color of the palette at the tone.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.get

func (*TonalPalette) GetHct

func (p *TonalPalette) GetHct(tone float64) *Hct

GetHct is the color of the palette at the tone. A tone that is a whole number and was asked before comes from the cache.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.getHct

func (*TonalPalette) Hue

func (p *TonalPalette) Hue() float64

Hue is the hue of the palette.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.hue

func (*TonalPalette) KeyColor

func (p *TonalPalette) KeyColor() *Hct

KeyColor is the key color of the palette: the color of the palette's hue with the tone that gives the requested chroma, closest to tone 50.

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.keyColor

func (*TonalPalette) String

func (p *TonalPalette) String() string

String is the palette as TonalPalette.of(hue, chroma) or TonalPalette.fromList(colors).

Flutter: material-color-utilities palettes/tonal_palette.dart TonalPalette.toString

type ToneDeltaPair

type ToneDeltaPair struct {
	// RoleA and RoleB are the colors of the pair.
	RoleA, RoleB *DynamicColor
	// Delta is the difference in tone that the colors must have, at least.
	Delta float64
	// Polarity says which of the colors is lighter, darker, nearer or farther.
	Polarity TonePolarity
	// StayTogether says that the colors must be moved together out of the
	// awkward zone of the tones 50 to 59.
	StayTogether bool
}

ToneDeltaPair documents a constraint between two DynamicColors, in which their tones must have a certain distance from each other.

Flutter: material-color-utilities dynamiccolor/src/tone_delta_pair.dart ToneDeltaPair

func NewToneDeltaPair

func NewToneDeltaPair(roleA, roleB *DynamicColor, delta float64, polarity TonePolarity, stayTogether bool) *ToneDeltaPair

NewToneDeltaPair creates a tone delta pair.

Flutter: material-color-utilities dynamiccolor/src/tone_delta_pair.dart ToneDeltaPair.new

type TonePolarity

type TonePolarity int

TonePolarity is the relationship of the tones of the two colors of a ToneDeltaPair.

Flutter: material-color-utilities dynamiccolor/src/tone_delta_pair.dart TonePolarity

const (
	// TonePolarityUnspecified is the zero value.
	//
	// Flutter: no counterpart
	TonePolarityUnspecified TonePolarity = iota
	// TonePolarityDarker: roleA must be darker than roleB.
	//
	// Flutter: material-color-utilities dynamiccolor/src/tone_delta_pair.dart TonePolarity.darker
	TonePolarityDarker
	// TonePolarityLighter: roleA must be lighter than roleB.
	//
	// Flutter: material-color-utilities dynamiccolor/src/tone_delta_pair.dart TonePolarity.lighter
	TonePolarityLighter
	// TonePolarityNearer: the one closer to the background is roleA: it is lighter
	// in a light scheme and darker in a dark one, and roleB is farther.
	//
	// Flutter: material-color-utilities dynamiccolor/src/tone_delta_pair.dart TonePolarity.nearer
	TonePolarityNearer
	// TonePolarityFarther: the one farther from the background is roleA.
	//
	// Flutter: material-color-utilities dynamiccolor/src/tone_delta_pair.dart TonePolarity.farther
	TonePolarityFarther
)

The tone polarities, in the order of Flutter's enum. TonePolarityUnspecified is the zero value and is not a polarity.

type Variant

type Variant int

Variant is a type of dynamic scheme: how its palettes are made from the source color.

Flutter: material-color-utilities dynamiccolor/variant.dart Variant

const (
	// VariantUnspecified is the zero value.
	//
	// Flutter: no counterpart
	VariantUnspecified Variant = iota
	// VariantMonochrome: all colors are grayscale, no chroma.
	//
	// Flutter: material-color-utilities dynamiccolor/variant.dart Variant.monochrome
	VariantMonochrome
	// VariantNeutral: close to grayscale, a hint of chroma.
	//
	// Flutter: material-color-utilities dynamiccolor/variant.dart Variant.neutral
	VariantNeutral
	// VariantTonalSpot: pastel tokens, low chroma palettes (32); the default
	// Material You theme at the 2021 launch.
	//
	// Flutter: material-color-utilities dynamiccolor/variant.dart Variant.tonalSpot
	VariantTonalSpot
	// VariantVibrant: pastel colors, high chroma palettes; the chroma of the
	// primary palette is at its maximum.
	//
	// Flutter: material-color-utilities dynamiccolor/variant.dart Variant.vibrant
	VariantVibrant
	// VariantExpressive: pastel colors, medium chroma palettes; the hue of the
	// primary palette is different from the source color, for variety.
	//
	// Flutter: material-color-utilities dynamiccolor/variant.dart Variant.expressive
	VariantExpressive
	// VariantContent: almost identical to fidelity; tokens and palettes match the
	// source color, and the tertiary palette is an analogue of it.
	//
	// Flutter: material-color-utilities dynamiccolor/variant.dart Variant.content
	VariantContent
	// VariantFidelity: tokens and palettes match the source color, and the tertiary
	// palette is its complement.
	//
	// Flutter: material-color-utilities dynamiccolor/variant.dart Variant.fidelity
	VariantFidelity
	// VariantRainbow: a playful theme; the hue of the source color does not appear
	// in the theme.
	//
	// Flutter: material-color-utilities dynamiccolor/variant.dart Variant.rainbow
	VariantRainbow
	// VariantFruitSalad: a playful theme; the hue of the source color does not
	// appear in the theme.
	//
	// Flutter: material-color-utilities dynamiccolor/variant.dart Variant.fruitSalad
	VariantFruitSalad
)

The variants, in the order of Flutter's enum. VariantUnspecified is the zero value and is not a variant.

func (Variant) Description

func (v Variant) Description() string

Description says how the variant makes its palettes.

Flutter: material-color-utilities dynamiccolor/variant.dart Variant.description

func (Variant) Label

func (v Variant) Label() string

Label is the name of the variant.

Flutter: material-color-utilities dynamiccolor/variant.dart Variant.label

type ViewingConditions

type ViewingConditions struct {
	WhitePoint            [3]float64
	AdaptingLuminance     float64
	BackgroundLstar       float64
	Surround              float64
	DiscountingIlluminant bool

	BackgroundYToWhitePointY float64
	Aw, Nbb, Ncb, C, NC      float64
	RgbD                     [3]float64
	Fl, FLRoot, Z            float64
}

ViewingConditions are the environment in which a color is viewed, as CAM16 takes it: the white point, the luminance that the eye is adapted to, the background and the surround, and the factors derived from them.

Flutter: material-color-utilities hct/viewing_conditions.dart ViewingConditions

func NewViewingConditions

func NewViewingConditions(o ViewingConditionsOpts) *ViewingConditions

NewViewingConditions creates viewing conditions from the options, with the defaults of Flutter's ViewingConditions.make.

Flutter: material-color-utilities hct/viewing_conditions.dart ViewingConditions.make

type ViewingConditionsOpts

type ViewingConditionsOpts struct {
	// WhitePoint is the white point in XYZ; the default is D65.
	WhitePoint foundation.Opt[[3]float64]
	// AdaptingLuminance is the luminance of the adapting field in cd/m2; the
	// default (unset, or zero or less) is 11.72, a 50% gray in an environment of
	// 200 lux.
	AdaptingLuminance foundation.Opt[float64]
	// BackgroundLstar is the L* of the background; the default is 50.
	BackgroundLstar foundation.Opt[float64]
	// Surround is the surround, from 0 (dark) to 2 (average); the default is 2.
	Surround foundation.Opt[float64]
	// DiscountingIlluminant is whether the eye discounts the illuminant.
	DiscountingIlluminant bool
}

ViewingConditionsOpts are the optional parameters of NewViewingConditions.

Flutter: material-color-utilities hct/viewing_conditions.dart ViewingConditions.make

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL