Results 1 to 2 of 2

Thread: RGB Colours .... Comparing

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Location
    UK
    Posts
    127

    RGB Colours .... Comparing

    sorry i posted in the classic forum to begin with ...

    im running the following code below to replace colours .... the code works fine but i need a way to break down RGB values to calculate if the colour is roughly in the same range as the image .... how can i do this

    any help would be great
    many thanks
    illskills


    VB Code:
    1. Dim mycc As New ColorConverter
    2.         pgbProgress.Maximum = 256
    3.         For iColour As Integer = 0 To 255
    4.  
    5.             pgbProgress.Value = iColour
    6.             pgbProgress.Refresh()
    7.             If Not IsNothing(arrColoursToReplace(iColour)) Then
    8.                 For i As Integer = 1 To 1000 '# loops throught mosaics
    9.                     If IsNothing(arrCustomMosaics(i, 0, 0)) Then Exit For
    10.                     For x As Integer = 1 To 15
    11.                         For y As Integer = 1 To 15
    12.                             If Not IsNothing(arrCustomMosaics(i, x, y)) Then
    13.                                 If mycc.ConvertToString(arrCustomMosaics(i, x, y).ToString) = mycc.ConvertToString(arrColoursToReplace(iColour).ToString) Then
    14.                                     arrColoursToReplace(iColour) = arrCustomMosaics(i, 0, 0)
    15.                                 End If
    16.                             End If
    17.                         Next
    18.                     Next
    19.                 Next
    20.             End If
    21.         Next
    22.         For i As Integer = 1 To 255
    23.             If Not IsNothing(arrColoursToReplace(i)) Then
    24.                 txtmytextbox.Text = txtmytextbox.Text & vbCrLf & arrColoursToReplace(i).tostring
    25.             End If
    26.         Next

  2. #2
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: RGB Colours .... Comparing

    isnt it something like

    color.torbga

    meaning it translates ur color into red blue green and alpha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width