(VB6) RGB visualizer

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
Post Reply
User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

(VB6) RGB visualizer

Post by RobertBell » Thu Jun 12, 2008 3:50 pm

This is a very simple VB6 application that connects to Palette to run this script (defined in an Auto Start macro):

Code: Select all

function newStack()
   return {""}   -- starts with an empty string
end

function addString(stack, s)
  table.insert(stack, s)    -- push 's' into the the stack
  for i=table.getn(stack)-1, 1, -1 do
    if string.len(stack[i]) > string.len(stack[i+1]) then
       break
     end
     stack[i] = stack[i] .. table.remove(stack)
   end
end

function GetRGB(StartFix, EndFix)
  local s = newStack()
  for i = StartFix, EndFix do
    Intensity = tonumber(HC.AttributeGetValue(i))
    addString(s, string.format('%02X', HC.AttributeGetValue(i,'Color A') * (Intensity / 100) * 2.55))
    addString(s, string.format('%02X', HC.AttributeGetValue(i,'Color B') * (Intensity / 100) * 2.55))
    addString(s, string.format('%02X', HC.AttributeGetValue(i,'Color C') * (Intensity / 100) * 2.55))
  end
  s = table.concat(s,'')

  print (s)
end
I found this very handy before we had the colour bubbles in the grid to show RGB FXs.
RGB demo app.jpg
RGB demo app.jpg (90.15 KiB) Viewed 792 times
Attachments
RGB Demoer.zip
(39.67 KiB) Downloaded 101 times
Robert Bell - Product Manager - Horizon Control Inc.

Post Reply