Examples: SetHSL method

This form action uses the "H," "S," and "L" fields on a form as parameters to SetHSL, and writes the resulting property values to the "NotesColor," "Red," "Green," "Blue," "Hue," "Saturation," and "Luminance" fields.

Sub Click(Source As Button)
  Dim session As New NotesSession
  Dim ws As New NotesUIWorkspace
  Dim doc As NotesDocument
  Dim color As NotesColorObject
  Set doc = ws.CurrentDocument.Document
  Set color = session.CreateColorObject
  notesColor = color.SetHSL(doc.H(0), doc.S(0), doc.L(0))
  Call doc.ReplaceItemValue("NotesColor", notesColor)
  Call doc.ReplaceItemValue("Red", color.Red)
  Call doc.ReplaceItemValue("Green", color.Green)
  Call doc.ReplaceItemValue("Blue", color.Blue)
  Call doc.ReplaceItemValue("Hue", color.Hue)
  Call doc.ReplaceItemValue("Saturation", color.Saturation)
  Call doc.ReplaceItemValue("Luminance", color.Luminance)
End Sub