Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,932 questions

51,869 answers

573 users

How to convert CMYK to RGB in VB.NET

1 Answer

0 votes
' 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
'

 



answered Jan 30, 2023 by avibootz
edited Jan 31, 2023 by avibootz

Related questions

1 answer 124 views
124 views asked Feb 1, 2023 by avibootz
1 answer 122 views
122 views asked Feb 2, 2023 by avibootz
1 answer 121 views
121 views asked Feb 1, 2023 by avibootz
1 answer 126 views
126 views asked Jan 31, 2023 by avibootz
1 answer 138 views
138 views asked Jan 31, 2023 by avibootz
1 answer 97 views
97 views asked Jan 31, 2023 by avibootz
1 answer 116 views
116 views asked Jan 31, 2023 by avibootz
...