This Python program can be used to convert colors in your Android project's values.xml
file, so that they reference values from the MaterialDesignUtils library.
For example, your file may contain <color name="theme_primary">#F44336</color>
, and this will be replaced with <color name="theme_primary">@color/mdu_red_500</color>
. This makes it much easier to read what color you have set to theme_primary
.
The MDU File Converter program is particularly useful if you have added or are using the MaterialDesignUtils library, as your color values will be referencing that library instead of lots of hex values.
Copyright 2016 Farbod Salamat-Zadeh
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.