Thread: Vapoursynth
View Single Post
Old 22nd May 2018, 02:32   #3095  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by foxyshadis View Post
Color is only ever read as a Python list of each value per plane. There's nothing keeping you from implementing a convenience function, however, like:

Code:
def Hex2List(colorhex):
  digits = math.ceil(colorhex ** (1/16.))
  colorlist = []
  for plane in range(0,digits):
    colorlist.append(colorhex % 256)
    colorhex = colorhex // 256
  return colorlist
And calling it as Hex2List(0x778899).

You can always use an actual list like [0x77, 0x88, 0x99], so the value of this convenience is questionable.
I'm talking about things like using it in blankclip like this, instead of the longer rgb value.

Code:
clip = core.std.BlankClip(color="#ffffff")
lansing is offline   Reply With Quote