Convert RGB value to Hex

From Scribus Wiki
Revision as of 02:05, 3 December 2008 by Gpittman (talk | contribs) (New page: <pre> #!/usr/bin/env python # File:rgb2hex.py # simple utility to convert rgb values to hex # within Scribus import scribus colorN = 255 while colorN != 0: color = scribus.valueDia...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
#!/usr/bin/env python

# File:rgb2hex.py
# simple utility to convert rgb values to hex 
# within Scribus

import scribus

colorN = 255
while colorN != 0:
    color = scribus.valueDialog('Color Values','Enter the RGB value, 0 to quit')
    if color == '': color = '255'
    colorN = int(color)
    hexN = hex(colorN)
    result = scribus.messageBox ('Hex Value','RGB value of '+ color + ' is \n Hex value of '+ hexN,scribus.BUTTON_OK)