Platforms to show: All Mac Windows Linux Cross-Platform

/MacBase/NSColor Matching


Required plugins for this example: MBS MacBase Plugin, MBS Main Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacBase/NSColor Matching

This example is the version from Sun, 20th Jul 2019.

Project "NSColor Matching.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control Canvas1 Inherits Canvas
ControlInstance Canvas1 Inherits Canvas
EventHandler Sub Paint(g As Graphics, areas() As REALbasic.Rect) g.ForeColor=RGB(Slider1.Value * 2.55, Slider2.Value * 2.55, Slider3.Value * 2.55) g.FillRect 0,0,Me.Width,Me.Height End EventHandler
End Control
Control Canvas2 Inherits Canvas
ControlInstance Canvas2 Inherits Canvas
EventHandler Sub Paint(g As Graphics, areas() As REALbasic.Rect) Dim gr As NSColorMBS gr = New NSColorMBS(Slider1.Value/100.0, Slider2.Value/100.0, Slider3.Value/100.0) g.ForeColor = gr.colorValue g.FillRect 0,0,Me.Width,Me.Height End EventHandler
End Control
Control Slider1 Inherits Slider
ControlInstance Slider1 Inherits Slider
EventHandler Sub ValueChanged() Label1.Text = Str(Me.Value) Canvas1.Invalidate Canvas2.Invalidate End EventHandler
End Control
Control Slider2 Inherits Slider
ControlInstance Slider2 Inherits Slider
EventHandler Sub ValueChanged() Label2.Text = Str(Me.Value) Canvas1.Invalidate Canvas2.Invalidate End EventHandler
End Control
Control Slider3 Inherits Slider
ControlInstance Slider3 Inherits Slider
EventHandler Sub ValueChanged() Label3.Text = Str(Me.Value) Canvas1.Invalidate Canvas2.Invalidate End EventHandler
End Control
Control Label1 Inherits Label
ControlInstance Label1 Inherits Label
End Control
Control Label2 Inherits Label
ControlInstance Label2 Inherits Label
End Control
Control Label3 Inherits Label
ControlInstance Label3 Inherits Label
End Control
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

The items on this page are in the following plugins: MBS MacBase Plugin.


The biggest plugin in space...