擅长:python、mysql、java
<p>扩展颜色选择</p>
<pre><code>from openpyxl.compat import unicode
from openpyxl.descriptors import Typed
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors.nested import NestedInteger
from openpyxl.xml.constants import DRAWING_NS
class MyRGBColor(Serialisable):
tagname = 'srgbClr'
namespace = DRAWING_NS
val = Typed(expected_type=unicode)
alpha = NestedInteger(allow_none=True)
__elements__ = ('alpha', )
def __init__(self, val, alpha=None):
self.val = val
self.alpha = alpha
class MyColorChoice(ColorChoice):
srgbClr = Typed(expected_type=MyRGBColor, allow_none=True)
</code></pre>
<p>…和</p>
^{pr2}$