ColorUint2 class

A 2-bit unsigned int color with channel values in the range [0, 3].

Inheritance
Implemented types
Available Extensions

Properties

a num
Alpha channel.
getter/setter pairoverride
aNormalized num
Normalized [0, 1] alpha.
getter/setter pairoverride
b num
Blue channel.
getter/setter pairoverride
bNormalized num
Normalized [0, 1] blue.
getter/setter pairoverride
data int
getter/setter pair
first num
The first element.
no setterinherited
format Format
The Format of the color.
no setteroverride
g num
Green channel.
getter/setter pairoverride
gNormalized num
Normalized [0, 1] green.
getter/setter pairoverride
hashCode int
The hash code for this object.
no setteroverride
hasPalette bool
True if the color uses a palette.
no setteroverride
index num
Palette index value (or red channel if there is no palette).
getter/setter pairoverride
isEmpty bool
Whether this collection has no elements.
no setterinherited
isHdrFormat bool
True if the format is high dynamic range.
no setteroverride
isLdrFormat bool
True if the format is low dynamic range.
no setteroverride
isNotEmpty bool
Whether this collection has at least one element.
no setterinherited
iterator ChannelIterator
A new Iterator that allows iterating the elements of this Iterable.
no setteroverride
last num
The last element.
no setterinherited
length int
The number of elements in this.
final
luminance num
The luminance (grayscale) of the color.
no setteroverride
luminanceNormalized num
no setteroverride
maxChannelValue num
The maximum value for a color channel.
no setteroverride
maxIndexValue num
The maximum value for a palette index.
no setteroverride
palette Palette?
The palette used by the color, or null.
no setteroverride
r num
Red channel.
getter/setter pairoverride
rNormalized num
Normalized [0, 1] red.
getter/setter pairoverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single num
Checks that this iterable has only one element, and returns that element.
no setterinherited

Methods

any(bool test(num element)) bool
Checks whether any element of this iterable satisfies test.
inherited
cast<R>() Iterable<R>
A view of this iterable as an iterable of R instances.
inherited
clone() ColorUint2
Returns a copy of the color.
override
contains(Object? element) bool
Whether the collection contains an element equal to element.
inherited
convert({Format? format, int? numChannels, num? alpha}) Color
Convert the format and/or the numChannels of the color. If numChannels is 4 and the current color does not have an alpha value, then alpha can specify what value to use for the new alpha channel. If alpha is not given, then maxChannelValue will be used.
override
elementAt(int index) num
Returns the indexth element.
inherited
every(bool test(num element)) bool
Checks whether every element of this iterable satisfies test.
inherited
expand<T>(Iterable<T> toElements(num element)) Iterable<T>
Expands each element of this Iterable into zero or more elements.
inherited
firstWhere(bool test(num element), {num orElse()?}) num
The first element that satisfies the given predicate test.
inherited
fold<T>(T initialValue, T combine(T previousValue, num element)) → T
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
inherited
followedBy(Iterable<num> other) Iterable<num>
Creates the lazy concatenation of this iterable and other.
inherited
forEach(void action(num element)) → void
Invokes action on each element of this iterable in iteration order.
inherited
getChannel(Channel channel) num
Get a channel from the color. If the channel isn't available, 0 will be returned.
override
getChannelNormalized(Channel channel) num
Get the normalized [0, 1] value of a channel from the color. If the channel isn't available, 0 will be returned.
override
join([String separator = ""]) String
Converts each element to a String and concatenates the strings.
inherited
lastWhere(bool test(num element), {num orElse()?}) num
The last element that satisfies the given predicate test.
inherited
map<T>(T toElement(num e)) Iterable<T>
The current elements of this iterable modified by toElement.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reduce(num combine(num value, num element)) num
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
inherited
set(Color c) → void
The the values of this color to the given color.
override
setRgb(num r, num g, num b) → void
Set the individual r, g, b channels of the color.
override
setRgba(num r, num g, num b, num a) → void
Set the individual r, g, b, a channels of the color.
override
singleWhere(bool test(num element), {num orElse()?}) num
The single element that satisfies test.
inherited
skip(int count) Iterable<num>
Creates an Iterable that provides all but the first count elements.
inherited
skipWhile(bool test(num value)) Iterable<num>
Creates an Iterable that skips leading elements while test is satisfied.
inherited
take(int count) Iterable<num>
Creates a lazy iterable of the count first elements of this iterable.
inherited
takeWhile(bool test(num value)) Iterable<num>
Creates a lazy iterable of the leading elements satisfying test.
inherited
toList({bool growable = true}) List<num>
Creates a List containing the elements of this Iterable.
inherited
toSet() Set<num>
Creates a Set containing the same elements as this iterable.
inherited
toString() String
Returns a string representation of (some of) the elements of this.
inherited
where(bool test(num element)) Iterable<num>
Creates a new lazy Iterable with all elements that satisfy the predicate test.
inherited
whereType<T>() Iterable<T>
Creates a new lazy Iterable with all elements that have type T.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override
operator [](int index) num
Gets a channel from the color by its index.
override
operator []=(int index, num value) → void
override