Given a token string name, look up the theme color for it and return as rbg(x,y,z) str
(tokenType)
| 94 | return f'Opcode: {padded}' |
| 95 | |
| 96 | def rgbStr(tokenType): |
| 97 | '''Given a token string name, look up the theme color for it and return as rbg(x,y,z) str''' |
| 98 | try: |
| 99 | color = eval(f'getThemeColor(ThemeColor.{tokenType})') |
| 100 | except: |
| 101 | color = None |
| 102 | if (not color): |
| 103 | try: |
| 104 | ctx = UIContext.activeContext() |
| 105 | view_frame = ctx.getCurrentViewFrame() |
| 106 | color = eval(f'getTokenColor(view_frame, InstructionTextTokenType.{tokenType})') |
| 107 | except: |
| 108 | return 'rgb(224, 224, 224)' |
| 109 | r = color.getRgb()[0] |
| 110 | g = color.getRgb()[1] |
| 111 | b = color.getRgb()[2] |
| 112 | return f"rgb({r}, {g}, {b})" |
| 113 | |
| 114 | def render_svg(function, offset, mode, form, showOpcodes, showAddresses, origname): |
| 115 | settings = DisassemblySettings() |