-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mob 35767 fix color generation #59
Conversation
…тно генерился путь к базовому цвету по stencil шаблону для android
@@ -131,7 +159,7 @@ final class DefaultColorTokensContextProvider: ColorTokensContextProvider { | |||
|
|||
let path = token.name.components(separatedBy: ".") | |||
|
|||
guard path[0] != "gradient" else { | |||
guard path[0] != "gradient" && !dayValue.contains("gradient") else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем тут эта проверка? path[0] != "gradient"
проверяет и так, что значение не начинается с gradient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Там появились новые токены у которых gradient только в value, ранее проверялся только name
{
"name": "color.component.scrollable-container.fade.content",
"value": "linear-gradient(0deg, rgba( {color.base.black} , {semantic.opacity.transparent}) 0%, {color.base.black} {semantic.opacity.visible})",
"type": "color",
"$extensions": {
"id": "928293bc-254c-4bab-801d-7b98132d150b"
}
},
```
@@ -32,7 +32,7 @@ final class DefaultTokensResolver: TokensResolver { | |||
return hexFloat / 255.0 | |||
} | |||
|
|||
private func makeColor(hex: String, alpha: CGFloat) throws -> Color { | |||
private func makeColor(hex: String, alpha: CGFloat, tokenName: String) throws -> Color { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tokenName
не используется?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, спасибо! Я хотела прокинуть в ошибку .invalidHEXComponent tokenName, но оказывается по code style нельзя только в 1 case enum-a прокинуть второй параметр. И я удалила этот код. Но часть забыла.
// Возвращает набор токенов для определенной темы. | ||
// Для undefined возвращается полный набор токенов. Нужен для Spacer, Font и других независимых от темы параметров. | ||
func getThemeTokenValues(theme: Theme) -> [TokenValue] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужно три слэша, тогда это будет документация метода:
/// Возвращает набор токенов для определенной темы.
/// Для undefined возвращается полный набор токенов. Нужен для Spacer, Font и других независимых от темы параметров.
func getThemeTokenValues(theme: Theme) -> [TokenValue] {
/// Resolving references and mathematical expressions in `value` from `tokenValues`. | ||
/// | ||
/// Reference example: `{core.space.1-x} + {core.space.1-x} / 2` | ||
/// where `core.space.1-x == 1` the resolved value would be `1 + 1 / 2` | ||
/// and after evaluating the mathematical expression, the function will return `1.5` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут описание стоит поправить, эта функция не резолвит самое значение, а только базовую ссылку
No description provided.