Color
46 nodes
On this page 46
Alpha
FunctionOpacity (Transparency), higher value means more opaque.
Alpha(Color: Color) -> Byte
byte Alpha(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Byte |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Blue
FunctionBlue channel, from 0 (none) to 255 (full).
Blue(Color: Color) -> Byte
byte Blue(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Byte |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Green
FunctionGreen channel, from 0 (none) to 255 (full).
Green(Color: Color) -> Byte
byte Green(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Byte |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Red
FunctionRed channel, from 0 (none) to 255 (full).
Red(Color: Color) -> Byte
byte Red(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Byte |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Make Color
FunctionOverload 1 of 7
ColorElement() -> Color
ColorElement ColorElement()
Creates transparent black: every channel, alpha included, is 0.
Returns
| result | Color |
Overload 2 of 7
ColorElement(singleValue: Byte) -> Color
ColorElement ColorElement(byte singleValue)
Creates an opaque gray, with red, green and blue all set to the same value and alpha 255.
Parameters
| name | type | default | description |
|---|---|---|---|
| singleValue | Byte | — | Gray level from 0 (black) to 255 (white). |
Returns
| result | Color |
Overload 3 of 7
ColorElement(singleValue: Byte, alpha: Byte) -> Color
ColorElement ColorElement(byte singleValue, byte alpha = 255)
Creates a gray, with red, green and blue all set to the same value, and the given opacity.
Parameters
| name | type | default | description |
|---|---|---|---|
| singleValue | Byte | — | Gray level from 0 (black) to 255 (white). |
| alpha | Byte | 255 | Opacity from 0 (fully transparent) to 255 (fully opaque). |
Returns
| result | Color |
Overload 4 of 7
ColorElement -> Color
red: Byte
green: Byte
blue: Byte
alpha: ByteColorElement ColorElement(
byte red,
byte green,
byte blue,
byte alpha = 255)Creates a color from its red, green, blue and alpha channels, each from 0 to 255.
Parameters
| name | type | default | description |
|---|---|---|---|
| red | Byte | — | Red channel, 0-255. |
| green | Byte | — | Green channel, 0-255. |
| blue | Byte | — | Blue channel, 0-255. |
| alpha | Byte | 255 | Opacity, 0 (fully transparent) to 255 (fully opaque); opaque when omitted. |
Returns
| result | Color |
Overload 5 of 7
ColorElement(bytes: Byte Array) -> Color
ColorElement ColorElement(byte[] bytes)
Creates a color from the first four bytes of an array, read in red, green, blue, alpha order.
Parameters
| name | type | default | description |
|---|---|---|---|
| bytes | Byte Array | — | At least four bytes; any beyond the fourth are ignored. Fewer than four throws System.IndexOutOfRangeException. |
Returns
| result | Color |
Overload 6 of 7
ColorElement(pixel: Pixel) -> Color
ColorElement ColorElement(Pixel pixel)
Creates a color from a BigGustave PNG pixel, copying its red, green, blue and alpha bytes unchanged.
Parameters
| name | type | default | description |
|---|---|---|---|
| pixel | Pixel | — | The PNG decoder's pixel. |
Returns
| result | Color |
Overload 7 of 7
ColorElement -> Color
r: Low Accuracy Number
g: Low Accuracy Number
b: Low Accuracy Number
a: Low Accuracy NumberColorElement ColorElement(float r, float g, float b, float a)
Creates a color from fractional channels in the 0-1 range, each multiplied by 255 and truncated (not rounded) to a byte.
Parameters
| name | type | default | description |
|---|---|---|---|
| r | Low Accuracy Number | — | Red channel, 0-1. |
| g | Low Accuracy Number | — | Green channel, 0-1. |
| b | Low Accuracy Number | — | Blue channel, 0-1. |
| a | Low Accuracy Number | — | Opacity, 0 (fully transparent) to 1 (fully opaque). |
Returns
| result | Color |
Remarks
Inputs are not clamped before the conversion, so keep every channel within 0-1.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Equals
FunctionOverload 1 of 2
Equals(Color: Color, other: Color) -> Truth
bool Equals(ColorElement Color, ColorElement other)
Whether both colors have exactly the same red, green, blue and alpha bytes.
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — | |
| other | Color | — | The color to compare with. |
Returns
| result | Truth |
Overload 2 of 2
Equals(Color: Color, obj: Any) -> Truth
bool Equals(ColorElement Color, object obj)
Whether Obj is a Image.ColorElement with exactly the same four channels.
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — | |
| obj | Any | — | The object to compare with. |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
Alpha Float
FunctionThe opacity as a fraction from 0 (fully transparent) to 1 (fully opaque).
AlphaFloat(Color: Color) -> Low Accuracy Number
float AlphaFloat(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Low Accuracy Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Blue Float
FunctionThe blue channel as a fraction from 0 to 1 (the byte divided by 255).
BlueFloat(Color: Color) -> Low Accuracy Number
float BlueFloat(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Low Accuracy Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Green Float
FunctionThe green channel as a fraction from 0 to 1 (the byte divided by 255).
GreenFloat(Color: Color) -> Low Accuracy Number
float GreenFloat(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Low Accuracy Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Red Float
FunctionThe red channel as a fraction from 0 to 1 (the byte divided by 255).
RedFloat(Color: Color) -> Low Accuracy Number
float RedFloat(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Low Accuracy Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Get Hash Code
FunctionA hash code built from all four channels, consistent with ColorElement.Equals.
GetHashCode(Color: Color) -> Integer
int GetHashCode(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
Save As Text
FunctionThe color as text, in the same "#RRGGBBAA" hex form as ColorElement.ToString.
SaveAsText(Color: Color) -> Text
string SaveAsText(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
To Console Color
FunctionConverts this Color instance to the closest matching ConsoleColor.
The match is determined by the Euclidean distance between RGB components.
ToConsoleColor(Color: Color) -> ConsoleColor
ConsoleColor ToConsoleColor(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | ConsoleColor |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
To Grayscale
FunctionA standard interpretation of (floating point) grayscale.
ToGrayscale(Color: Color) -> Low Accuracy Number
float ToGrayscale(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Low Accuracy Number |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
To Hex
FunctionConvert color to RGB hex representation.
ToHex(Color: Color, alpha: Truth) -> Text
string ToHex(ColorElement Color, bool alpha = false)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — | |
| alpha | Truth | False |
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
To Luminance
FunctionThe perceived brightness of the color as a gray level, weighting red, green and blue as 0.299, 0.587 and 0.114 (Rec. 601) and rounding to the nearest byte.
ToLuminance(Color: Color) -> Byte
byte ToLuminance(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Byte |
Remarks
The weights are applied to the stored bytes directly, without converting from sRGB to linear light. Alpha is ignored.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
To Red Gray
FunctionTreats the color as a grayscale value by taking its red channel alone, the convention this library uses for single-channel images.
ToRedGray(Color: Color) -> Byte
byte ToRedGray(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Byte |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
To String
FunctionReturns a hexadecimal string representation of the Image.ColorElement.
ToString(Color: Color) -> Text
string ToString(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
To Tuple3
FunctionThe red, green and blue bytes (0-255) as a tuple, dropping alpha.
ToTuple3(Color: Color) -> (Byte, Byte, Byte)
(byte, byte, byte) ToTuple3(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | (Byte, Byte, Byte) |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
To Tuple4
FunctionThe red, green, blue and alpha bytes (0-255) as a tuple.
ToTuple4(Color: Color) -> (Byte, Byte, Byte, Byte)
(byte, byte, byte, byte) ToTuple4(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | (Byte, Byte, Byte, Byte) |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
To Vector3
FunctionThe red, green and blue channels as fractions from 0 to 1 in X, Y and Z, dropping alpha.
ToVector3(Color: Color) -> Vector3
Vector3 ToVector3(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Vector3 |
Remarks
The bytes are divided by 255 as stored; no sRGB-to-linear conversion is applied.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
To Vector4
FunctionThe red, green, blue and alpha channels as fractions from 0 to 1 in X, Y, Z and W.
ToVector4(Color: Color) -> Vector4
Vector4 ToVector4(ColorElement Color)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — |
Returns
| result | Vector4 |
Remarks
The bytes are divided by 255 as stored; no sRGB-to-linear conversion is applied.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
With Alpha
FunctionReturns a copy of this color with the same red, green and blue but a different opacity.
WithAlpha(Color: Color, alpha: Byte) -> Color
ColorElement WithAlpha(ColorElement Color, byte alpha)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — | |
| alpha | Byte | — | The new opacity, 0 (fully transparent) to 255 (fully opaque). |
Returns
| result | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
Write To Stream
FunctionWrites the color as four raw bytes, red, green, blue then alpha.
WriteToStream -> Large Integer
Color: Color
writer: BinaryWriterlong WriteToStream(ColorElement Color, BinaryWriter writer)
Parameters
| name | type | default | description |
|---|---|---|---|
| Color | Color | — | |
| writer | BinaryWriter | — | The writer to append to. |
Returns
| result | Large Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Color
- Package
- Image Processing
From Argb
FunctionCreates a color from alpha, red, green and blue bytes, given alpha first.
FromArgb(a: Byte, r: Byte, g: Byte, b: Byte) -> Color
ColorElement FromArgb(byte a, byte r, byte g, byte b)
Parameters
| name | type | default | description |
|---|---|---|---|
| a | Byte | — | Opacity, 0 (fully transparent) to 255 (fully opaque). |
| r | Byte | — | Red channel, 0-255. |
| g | Byte | — | Green channel, 0-255. |
| b | Byte | — | Blue channel, 0-255. |
Returns
| result | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
From Console Color
FunctionConverts a ConsoleColor to a Color instance using a fixed mapping.
FromConsoleColor(consoleColor: ConsoleColor) -> Color
ColorElement FromConsoleColor(ConsoleColor consoleColor)
Parameters
| name | type | default | description |
|---|---|---|---|
| consoleColor | ConsoleColor | — |
Returns
| result | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
From Rgb
FunctionCreates a fully opaque color from red, green and blue bytes.
FromRgb(r: Byte, g: Byte, b: Byte) -> Color
ColorElement FromRgb(byte r, byte g, byte b)
Parameters
| name | type | default | description |
|---|---|---|---|
| r | Byte | — | Red channel, 0-255. |
| g | Byte | — | Green channel, 0-255. |
| b | Byte | — | Blue channel, 0-255. |
Returns
| result | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
From Sc Rgb
FunctionThis node carries no documentation.
FromScRgb -> Color
a: Integer
r: Low Accuracy Number
g: Low Accuracy Number
b: Low Accuracy NumberColorElement FromScRgb(int a, float r, float g, float b)
Parameters
| name | type | default | description |
|---|---|---|---|
| a | Integer | — | |
| r | Low Accuracy Number | — | |
| g | Low Accuracy Number | — | |
| b | Low Accuracy Number | — |
Returns
| result | Color |
Remarks
TODO: looks broken. this forwards to the all-float constructor, so a gets multiplied by 255 again — FromScRgb(255, ...). Look at usages and see how to/whether to fix this.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
From Unit Float
FunctionThis node carries no documentation.
FromUnitFloat(value: Low Accuracy Number) -> Color
ColorElement FromUnitFloat(float value)
Parameters
| name | type | default | description |
|---|---|---|---|
| value | Low Accuracy Number | — | Value between 0-1 |
Returns
| result | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Get Color Nullable
FunctionGets color from serialization.
GetColorNullable(bytes: Byte Array) -> Optional Color
ColorElement? GetColorNullable(byte[] bytes)
Parameters
| name | type | default | description |
|---|---|---|---|
| bytes | Byte Array | — |
Returns
| result | Optional Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Interp
FunctionOverload 1 of 3
Interp(c1: Color, c2: Color, alpha: Byte) -> Color
ColorElement Interp(
ColorElement c1,
ColorElement c2,
byte alpha)This node carries no documentation.
Parameters
| name | type | default | description |
|---|---|---|---|
| c1 | Color | — | |
| c2 | Color | — | |
| alpha | Byte | — |
Returns
| result | Color |
Remarks
Ignores alpha, effectively assumping premultiplied.
Overload 2 of 3
Interp(c1: Color, c2: Color, ratio: Number) -> Color
ColorElement Interp(
ColorElement c1,
ColorElement c2,
double ratio)This node carries no documentation.
Parameters
| name | type | default | description |
|---|---|---|---|
| c1 | Color | — | |
| c2 | Color | — | |
| ratio | Number | — |
Returns
| result | Color |
Remarks
Ignores alpha, effectively assumping premultiplied.
Overload 3 of 3
Interp -> Color
from: Color
to: Color
blend: Low Accuracy Number
useAlphaFromTarget: TruthColorElement Interp(
ColorElement from,
ColorElement to,
float blend,
bool useAlphaFromTarget)Linear interpolate with proper alpha treatment.
Parameters
| name | type | default | description |
|---|---|---|---|
| from | Color | — | The color returned at a blend of 0. |
| to | Color | — | The color blended towards; reached at a blend of 1 (and, when Use Alpha From Target is set, only if it is fully opaque). |
| blend | Low Accuracy Number | — | Value between 0-1 |
| useAlphaFromTarget | Truth | — |
Returns
| result | Color |
Remarks
In general, this is a weird operation; Use with care at call site - likely we would want something more well defined.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Load From Text
FunctionReads a color from text, accepting the same hex codes and color names as ColorElement.Parse.
LoadFromText(text: Text) -> Color
ColorElement LoadFromText(string text)
Parameters
| name | type | default | description |
|---|---|---|---|
| text | Text | — | A hex code such as "#RRGGBBAA" or a Image.MediaColors name. |
Returns
| result | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Multiply Rgb Preserve Alpha
FunctionBrightens or darkens a color by multiplying red, green and blue by a factor, keeping its alpha unchanged.
MultiplyRgbPreserveAlpha -> Color
color: Color
multiplier: NumberColorElement MultiplyRgbPreserveAlpha(
ColorElement color,
double multiplier)Parameters
| name | type | default | description |
|---|---|---|---|
| color | Color | — | The color to scale. |
| multiplier | Number | — | The factor applied to each of red, green and blue; 1 leaves the color unchanged. |
Returns
| result | Color |
Remarks
Each channel is rounded and clamped to 0-255, so a large factor saturates at white rather than wrapping; a NaN or infinite product gives 0.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Addition Operation
FunctionAdds two colors channel by channel for red, green and blue; the result is always opaque.
op_Addition(a: Color, b: Color) -> Color
ColorElement op_Addition(ColorElement a, ColorElement b)
Parameters
| name | type | default | description |
|---|---|---|---|
| a | Color | — | The first color; its alpha is ignored. |
| b | Color | — | The second color; its alpha is ignored. |
Returns
| result | Color |
Remarks
The byte arithmetic wraps rather than clamps: a channel that would exceed 255 comes back near 0.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Equality Operation
FunctionWhether two colors have exactly the same red, green, blue and alpha bytes.
op_Equality(left: Color, right: Color) -> Truth
bool op_Equality(ColorElement left, ColorElement right)
Parameters
| name | type | default | description |
|---|---|---|---|
| left | Color | — | The first color. |
| right | Color | — | The second color. |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Inequality Operation
FunctionWhether two colors differ in any of red, green, blue or alpha.
op_Inequality(left: Color, right: Color) -> Truth
bool op_Inequality(ColorElement left, ColorElement right)
Parameters
| name | type | default | description |
|---|---|---|---|
| left | Color | — | The first color. |
| right | Color | — | The second color. |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Multiply Operation
FunctionScales red, green and blue by a factor, truncating each result to a byte; the result is always opaque.
op_Multiply(a: Color, m: Number) -> Color
ColorElement op_Multiply(ColorElement a, double m)
Parameters
| name | type | default | description |
|---|---|---|---|
| a | Color | — | The color to scale; its alpha is ignored. |
| m | Number | — | The factor applied to each of red, green and blue. |
Returns
| result | Color |
Remarks
Results are not clamped, so keep the factor small enough that no channel exceeds 255; ColorElement.MultiplyRgbPreserveAlpha clamps and keeps alpha.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Subtraction Operation
FunctionSubtracts one color from another channel by channel for red, green and blue; the result is always opaque.
op_Subtraction(a: Color, b: Color) -> Color
ColorElement op_Subtraction(ColorElement a, ColorElement b)
Parameters
| name | type | default | description |
|---|---|---|---|
| a | Color | — | The color subtracted from; its alpha is ignored. |
| b | Color | — | The color subtracted; its alpha is ignored. |
Returns
| result | Color |
Remarks
The byte arithmetic wraps rather than clamps: a channel that would go below 0 comes back near 255.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Parse
FunctionParses a string representation of a color and returns the corresponding Image.ColorElement instance.
Parse(textColor: Text) -> Color
ColorElement Parse(string textColor)
Parameters
| name | type | default | description |
|---|---|---|---|
| textColor | Text | — | A string representing the color. This can either be a hexadecimal value (starting with '#') in the format "#RRGGBB" or "#RRGGBBAA" (with an optional alpha component) or the name of a predefined color in Image.MediaColors. |
Returns
| result | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Parse Hex ARGB
FunctionParses a hexadecimal string representation of a color in ARGB order.
ParseHexARGB(hex: Text) -> Color
ColorElement ParseHexARGB(string hex)
Parameters
| name | type | default | description |
|---|---|---|---|
| hex | Text | — | A hexadecimal string representing the color. The string may optionally start with '#' and must be in the format "AARRGGBB", where the alpha component comes first. |
Returns
| result | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Parse Hex RGBA
FunctionParses a hexadecimal string representation of a color in RGBA order.
ParseHexRGBA(hex: Text) -> Color
ColorElement ParseHexRGBA(string hex)
Parameters
| name | type | default | description |
|---|---|---|---|
| hex | Text | — | A hexadecimal string representing the color. The string may optionally start with '#' and must be in the format "RRGGBB" or "RRGGBBAA", where the alpha component is optional and defaults to 255 if omitted. |
Returns
| result | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Read From Stream
FunctionReads a color written by ColorElement.WriteToStream: four bytes, red, green, blue then alpha.
ReadFromStream(reader: BinaryReader) -> (result: Large Integer, value: Color)
long ReadFromStream(BinaryReader reader, out ColorElement value)
Parameters
| name | type | default | description |
|---|---|---|---|
| reader | BinaryReader | — | The reader positioned at the color. |
Returns
| result | Large Integer |
| value | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Serialize
FunctionNullable serialization helper.
Serialize(value: Optional Color) -> Byte Array
byte[] Serialize(ColorElement? value)
Parameters
| name | type | default | description |
|---|---|---|---|
| value | Optional Color | — | Can be null |
Returns
| result | Byte Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Try Parse
FunctionTries to read a color from text, either a hex code starting with '#' or the name of a color in Image.MediaColors, without throwing on bad input.
TryParse(textColor: Text) -> (result: Truth, color: Color)
bool TryParse(string textColor, out ColorElement color)
Parameters
| name | type | default | description |
|---|---|---|---|
| textColor | Text | — | The text to parse, such as "#FF8000", "#FF800080" or "Orange". |
Returns
| result | Truth |
| color | Color |
Remarks
Surrounding whitespace is ignored and color names are matched case-insensitively. A hex code is read as "#RRGGBB" or "#RRGGBBAA" (see ColorElement.TryParseHexRGBA).
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Try Parse Hex ARGB
FunctionTries to read a hex color in alpha, red, green, blue order (the order XAML color codes use), without throwing on bad input.
TryParseHexARGB(hex: Text) -> (result: Truth, color: Color)
bool TryParseHexARGB(string hex, out ColorElement color)
Parameters
| name | type | default | description |
|---|---|---|---|
| hex | Text | — | Exactly eight hex digits, "AARRGGBB", optionally preceded by '#' and surrounded by whitespace. |
Returns
| result | Truth |
| color | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing
Try Parse Hex RGBA
FunctionTries to read a hex color in red, green, blue, alpha order, without throwing on bad input.
TryParseHexRGBA(hex: Text) -> (result: Truth, color: Color)
bool TryParseHexRGBA(string hex, out ColorElement color)
Parameters
| name | type | default | description |
|---|---|---|---|
| hex | Text | — | Six or eight hex digits, "RRGGBB" or "RRGGBBAA", optionally preceded by '#' and surrounded by whitespace. Alpha defaults to 255 (opaque) when only six digits are given. |
Returns
| result | Truth |
| color | Color |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Color
- Package
- Image Processing