![]() |
Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2025.
|
Allow the user to edit a color gradient. More...
Public Types | |
| enum | DisplayFlag { HIDE = 0 , SHOW_FOREGROUND = 1 , SHOW_BACKGROUND = 2 } |
| Available options for the display of the gradient palette. Use SColorGradient.HIDE. More... | |
| enum | Interpolation { Linear = 0 , HSLCounterClockwise = 5 , HSLClockwise = 6 , HSLShortest = 7 , HSLLongest = 8 } |
| Interpolation method to define how the color is interpolate between two cursors. More... | |
Public Member Functions | |
| Object | AddCursor (number position) |
| Add a new cursor in the color gradient. More... | |
| Object | DeleteCursor (number index) |
| Remove a cursor of the color gradient. More... | |
| Object | GetColorFromValue (number value) |
| Get the color corresponding to a specific value in the gradient. More... | |
| Object | GetColUndefined () |
| Get the undefined color of the color gradient. More... | |
| Object | GetCursorInfo (number index) |
| Get information about cursor with given index. More... | |
| number | GetNbCursor () |
| Get the number of cursors in the SColorGradient. More... | |
| number | GetNbCursorMax () |
| Get the maximal number of cursors you can have in this SColorGradient. More... | |
| Object | GetRange () |
| Get the maximal and minimal value of the color gradient. More... | |
| Object | SetColAfter (number index, number red, number green, number blue, number alpha=-1) |
| Set the color of a cursor after the value of the cursor. More... | |
| Object | SetColBefore (number index, number red, number green, number blue, number alpha=-1) |
| Set the color of a cursor before the value of the cursor. More... | |
| SetColUndefined (number red, number green, number blue, number alpha=-1) | |
| Set the undefined color of the color gradient. More... | |
| Object | SetCursorPos (number index, number position) |
| Set the position of the cursor with given index. More... | |
| SetDisplayOption (DisplayFlag displayPalette) | |
| Choose how the palette will be displayed. More... | |
| SetInterpolation (Interpolation method) | |
| Define how the color is interpolated between 2 cursors. More... | |
| SetMagnification (number magnification) | |
| Enlarge the hair diagram (only for inspected SPolyline) More... | |
| Object | SetNbCursor (number nbCursor) |
| Set the number of cursors of the color gradient. More... | |
| Object | SetRange (number minValue, number maxValue) |
| Update the min and max values of the color gradient, and delete all invalid pegs. More... | |
| string | toString () |
| Get the type of the variable. More... | |
Allow the user to edit a color gradient.
You cannot create a new color gradient. You can access to it by calling GetColorGradient() on a SMultiline, SPoly or SCloud. With this class you can manipulate color and cursor position of an existing color gradient.
Available options for the display of the gradient palette. Use SColorGradient.HIDE.
| Enumerator | |
|---|---|
| HIDE | The gradient is not displayed. |
| SHOW_FOREGROUND | The gradient is displayed in foreground. |
| SHOW_BACKGROUND | The gradient is displayed in background. |
| Object SColorGradient::AddCursor | ( | number | position | ) |
Add a new cursor in the color gradient.
| position | (number) The position of the new cursor |
| ret.ErrorCode | (number) The error code.
|
| ret.Index | (number) The index of your new cursor |
| Object SColorGradient::DeleteCursor | ( | number | index | ) |
Remove a cursor of the color gradient.
| index | (number) The index of the cursor to remove |
| ret.ErrorCode | (number) The error code
|
| Object SColorGradient::GetColorFromValue | ( | number | value | ) |
Get the color corresponding to a specific value in the gradient.
| value | (number) The value to get the color |
| ret.ErrorCode | (number) The error code
|
| ret.Red | (number) The red color (between 0 and 1) |
| ret.Green | (number) The green color (between 0 and 1) |
| ret.Blue | (number) The blue color (between 0 and 1) |
| Object SColorGradient::GetColUndefined | ( | ) |
Get the undefined color of the color gradient.
| ret.Red | (number) The undefined red color (between 0 and 1) |
| ret.Green | (number) The undefined green color (between 0 and 1) |
| ret.Blue | (number) The undefined blue color (between 0 and 1) |
| Object SColorGradient::GetCursorInfo | ( | number | index | ) |
Get information about cursor with given index.
| index | (number) The index of the cursor. |
| ret.ErrorCode | (number) The error code
|
| ret.RedBefore | (number) The red color before the cursor (between 0 and 1). |
| ret.GreenBefore | (number) The green color before the cursor (between 0 and 1). |
| ret.BlueBefore | (number) The blue color before the cursor (between 0 and 1). |
| ret.RedAfter | (number) The red color after the cursor (between 0 and 1). |
| ret.GreenAfter | (number) The green color after the cursor (between 0 and 1). |
| ret.BlueAfter | (number) The blue color after the cursor (between 0 and 1). |
| ret.Position | (number) The position of the cursor. |
| number SColorGradient::GetNbCursor | ( | ) |
Get the number of cursors in the SColorGradient.
| number SColorGradient::GetNbCursorMax | ( | ) |
Get the maximal number of cursors you can have in this SColorGradient.
| Object SColorGradient::GetRange | ( | ) |
Get the maximal and minimal value of the color gradient.
| ret.Max | (number) The maximal value. |
| ret.Min | (number) The minimal value. |
| Object SColorGradient::SetColAfter | ( | number | index, |
| number | red, | ||
| number | green, | ||
| number | blue, | ||
| number | alpha = -1 |
||
| ) |
Set the color of a cursor after the value of the cursor.
| index | (number) The index of the cursor (between 0 and the number of cursors) |
| red | (number) The red color (between 0 and 1) |
| green | (number) The green color (between 0 and 1) |
| blue | (number) The blue color (between 0 and 1) |
| alpha | (number) The alpha value (between 0 and 1) or a negative value to keep the current value |
| ret.ErrorCode | (number) The error code
|
| Object SColorGradient::SetColBefore | ( | number | index, |
| number | red, | ||
| number | green, | ||
| number | blue, | ||
| number | alpha = -1 |
||
| ) |
Set the color of a cursor before the value of the cursor.
| index | (number) The index of the cursor (between 0 and the number of cursors) |
| red | (number) The red color (between 0 and 1) |
| green | (number) The green color (between 0 and 1) |
| blue | (number) The blue color (between 0 and 1) |
| alpha | (number) The alpha value (between 0 and 1) or a negative value to keep the current value |
| ret.ErrorCode | (number) The error code
|
| SColorGradient::SetColUndefined | ( | number | red, |
| number | green, | ||
| number | blue, | ||
| number | alpha = -1 |
||
| ) |
Set the undefined color of the color gradient.
| red | (number) The red color (between 0 and 1) |
| green | (number) The green color (between 0 and 1) |
| blue | (number) The blue color (between 0 and 1) |
| alpha | (number) The alpha value (between 0 and 1) or a negative value to keep the current value |
| Object SColorGradient::SetCursorPos | ( | number | index, |
| number | position | ||
| ) |
Set the position of the cursor with given index.
| index | (number) The index of the cursor to update |
| position | (number) The position to set. |
| ret.ErrorCode | (number) The error code
|
| SColorGradient::SetDisplayOption | ( | DisplayFlag | displayPalette | ) |
Choose how the palette will be displayed.
| displayPalette | (DisplayFlag) The display option to use
|
| SColorGradient::SetInterpolation | ( | Interpolation | method | ) |
Define how the color is interpolated between 2 cursors.
| method | (Interpolation) The interpolation method to use.
|
| SColorGradient::SetMagnification | ( | number | magnification | ) |
Enlarge the hair diagram (only for inspected SPolyline)
| magnification | (number) The magnification factor (> 0) |
| Object SColorGradient::SetNbCursor | ( | number | nbCursor | ) |
Set the number of cursors of the color gradient.
| nbCursor | (number) The number of cursors to set. |
| ret.ErrorCode | (number) The error code.
|
| Object SColorGradient::SetRange | ( | number | minValue, |
| number | maxValue | ||
| ) |
Update the min and max values of the color gradient, and delete all invalid pegs.
| minValue | (number) The minimal value of the SColorGradient |
| maxValue | (number) The maximal value of the SColorGradient |
| ret.ErrorCode | (number) The error code
|
| string SColorGradient::toString | ( | ) |
Get the type of the variable.