소스 검색

Include color field on user; add bright luminosity option to color generation

sbkwgh 8 년 전
부모
커밋
4b559e50e1
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      models/category.js

+ 2 - 2
models/category.js

@@ -18,7 +18,7 @@ module.exports = (sequelize, DataTypes) => {
 		color: {
 			type: DataTypes.STRING,
 			defaultValue () {
-				return randomColor()
+				return randomColor({ luminosity: 'bright' })
 			}
 		}
 	}, {
@@ -32,7 +32,7 @@ module.exports = (sequelize, DataTypes) => {
 					model: models.Thread, 
 					include: [
 						models.Category,
-						{ model: models.User, attributes: ['username', 'createdAt', 'id'] }, 
+						{ model: models.User, attributes: ['username', 'createdAt', 'id', 'color'] }, 
 						{
 							model: models.Post, limit: 1, order: [['id', order]], include:
 							[{ model: models.User, attributes: ['username', 'id'] }]