MiuixColorPalette class
Miuix 风格的 HSV 网格调色板。对应 Kotlin ColorPalette。
color 是外部受控颜色;用户在网格中按下或拖动,以及调节透明度时, 都会通过 onColorChanged 返回新颜色。默认网格为 7 行、12 个色相列, 并在末尾附加一个灰阶列。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MiuixColorPalette
Constructors
-
MiuixColorPalette({Key? key, required Color color, required ValueChanged<
Color> onColorChanged, int rows = MiuixColorPaletteDefaults.rows, int hueColumns = MiuixColorPaletteDefaults.hueColumns, bool includeGrayColumn = MiuixColorPaletteDefaults.includeGrayColumn, bool showPreview = MiuixColorPaletteDefaults.showPreview, double cornerRadius = MiuixColorPaletteDefaults.cornerRadius, double indicatorRadius = MiuixColorPaletteDefaults.indicatorRadius}) -
const
Properties
- color → Color
-
当前颜色。
final
- cornerRadius → double
-
网格 squircle 圆角半径。
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hueColumns → int
-
色相列数。
final
- includeGrayColumn → bool
-
是否在色相列后显示灰阶列。
final
- indicatorRadius → double
-
选中指示器圆环半径。
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onColorChanged
→ ValueChanged<
Color> -
用户选色或调节透明度时调用。
final
- rows → int
-
色彩网格行数。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showPreview → bool
-
是否显示顶部颜色预览。
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MiuixColorPalette> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited