Property

Property

Methods

(static) arrayToColorObject(value) → {PropertyObject}

Source:
convert array to PropertyObject[type=color]. default model "rgba"
Example
arrayToColorObject([0, 0, 0])
// => PropertyObject(type="color", model="rgba", value=[0, 0, 0, 1], separator=",")
Parameters:
Name Type Description
value Array | PropertyObject ex) [0, 0, 0, 1]
Returns:
PropertyObject[type=color]
Type
PropertyObject

(static) splitComma(text) → {Array}

Source:
divide text by comma.
Example
console.log(splitComma("a,b,c,d,e,f,g"));
// ["a", "b", "c", "d", "e", "f", "g"]
console.log(splitComma("'a,b',c,'d,e',f,g"));
// ["'a,b'", "c", "'d,e'", "f", "g"]
Parameters:
Name Type Description
text String text to divide
Returns:
divided texts
Type
Array

(static) splitSpace(text) → {Array}

Source:
divide text by space.
Example
console.log(splitSpace("a b c d e f g"));
// ["a", "b", "c", "d", "e", "f", "g"]
console.log(splitSpace("'a,b' c 'd,e' f g"));
// ["'a,b'", "c", "'d,e'", "f", "g"]
Parameters:
Name Type Description
text String text to divide
Returns:
divided texts
Type
Array

(static) stringToColorObject(value) → {PropertyObject}

Source:
convert text with parentheses to PropertyObject[type=color]. If the values are not RGBA model, change them RGBA mdoel.
Example
stringToColorObject("rgba(0, 0, 0,1)")
// => PropertyObject(type="color", model="rgba", value=[0, 0, 0,1], separator=",")
Parameters:
Name Type Description
value String | PropertyObject ex) "rgba(0,0,0,1)"
Returns:
PropertyObject[type=color]
Type
PropertyObject

(static) toBracketObject(value) → {PropertyObject}

Source:
convert text with parentheses to PropertyObject.
Example
toBracketObject("abcde(0, 0, 0,1)")
// => PropertyObject(model="abcde", value=[0, 0, 0,1], separator=",")
Parameters:
Name Type Description
value String ex) "rgba(0,0,0,1)"
Returns:
PropertyObject
Type
PropertyObject

(static) toColorObject(value) → {PropertyObject}

Source:
convert text with parentheses to PropertyObject[type=color]. If the values are not RGBA model, change them RGBA mdoel.
Example
toColorObject("rgba(0, 0, 0,1)")
// => PropertyObject(type="color", model="rgba", value=[0, 0, 0,1], separator=",")
Parameters:
Name Type Description
value String | PropertyObject color value "rgba(0,0,0,1)"
Returns:
PropertyObject[type=color]
Type
PropertyObject

(static) toPropertyObject(value) → {String|PropertyObject}

Source:
See:
convert CSS Value to PropertyObject
Example
toPropertyObject("1px solid #000");
// => PropertyObject(["1px", "solid", rgba(0, 0, 0, 1)])
Parameters:
Name Type Description
value String it's text contains the array.
Returns:
  • Not Array, Not Separator, Only Number & Unit
    Type
    String
  • Array with Separator.
    Type
    PropertyObject