NotesColor (NotesColorObject - JavaScript™)
Read-write. The color's Domino® value.
Defined in
NotesColorObjectSyntax
getNotesColor() : int
setNotesColor(notesColor:int)
: void
Usage
The value of this property must be in the range 0-240.The methods setHSL and setRGB set this property.
Setting this property sets the RGB and HSL properties.
Language cross-reference
NotesColor property in LotusScript® NotesColorObject classNotesColor property in Java™ ColorObject class
Examples
This button control sets a color according to red, green, and blue values from scoped variables bound to input box controls. It assigns the Domino®, RGB, and HSL values of the color to scoped variables bound to input box controls.var color = session.createColorObject();
try {
if (isNaN(requestScope.red)) throw ("Red value must be numeric");
if (isNaN(requestScope.green)) throw ("Green value must be numeric");
if (isNaN(requestScope.blue)) throw ("Blue value must be numeric");
var red = parseInt(requestScope.red, 10);
var green = parseInt(requestScope.green, 10);
var blue = parseInt(requestScope.blue, 10);
if (red < 0 || red > 255) throw ("Red value must be 0 - 255");
if (green < 0 || green > 255) throw ("Green value must be 0 - 255");
if (blue < 0 || blue > 255) throw ("Blue value must be 0 - 255");
color.setRGB(red, green, blue);
requestScope.notescolor = color.getNotesColor().toFixed();
requestScope.red = color.getRed().toFixed();
requestScope.green = color.getGreen().toFixed();
requestScope.blue = color.getBlue().toFixed();
requestScope.hue = color.getHue().toFixed();
requestScope.saturation = color.getSaturation().toFixed();
requestScope.luminance = color.getLuminance().toFixed();
requestScope.status = "Success";
} catch(e) {
requestScope.status = e.toString();
}
This button gets a Domino® color
code from a scoped variable bound to an input box control. It assigns
to scoped variables bound to other input box controls the RGB and
HSL values of the color.
var color = session.createColorObject();
try {
if (isNaN(requestScope.notescolor)) throw ("NotesColor value must be numeric");
var notescolor = parseInt(requestScope.notescolor, 10);
if (notescolor < 0 || notescolor > 240) throw ("NotesColor value must be 0 - 240");
color.setNotesColor(notescolor);
requestScope.red = color.getRed().toFixed();
requestScope.green = color.getGreen().toFixed();
requestScope.blue = color.getBlue().toFixed();
requestScope.hue = color.getHue().toFixed();
requestScope.saturation = color.getSaturation().toFixed();
requestScope.luminance = color.getLuminance().toFixed();
requestScope.status = "Success";
} catch(e) {
requestScope.status = e.toString();
}