' CMYK = Cyan, Magenta, Yellow, Key(black)
' RGB = Red, Green, Blue
Imports System
Public Class Progam
Public Shared Function cmykToRgb(ByVal c As Double, ByVal m As Double, ByVal y As Double, ByVal k As Double) As Double()
Dim r As Double = CInt((255 * (1 - c / 100.0) * (1 - k / 100.0)))
Dim g As Double = CInt((255 * (1 - m / 100.0) * (1 - k / 100.0)))
Dim b As Double = CInt((255 * (1 - y / 100.0) * (1 - k / 100.0)))
Return New Double() {r, g, b}
End Function
Public Shared Sub Main(ByVal args As String())
Dim rgb As Double() = cmykToRgb(0.0, 16.0, 100.0, 0.0)
For Each item As Double In rgb
Console.WriteLine(item)
Next
End Sub
End Class
' run:
'
' 255
' 214
' 0
'